In case of a selected directory the option panel of screensaver will let you choose a time between 1 and 30 minutes after which the GIF file is randomly changed.
You can either open only one single GIF file or you can choose a directory that contains more than one GIF file. The background mode can be enabled under 'Screen Saver Options' in macOS. It also has a background mode to let you run the gif as a desktop background (or wallpaper). AnimatedGif is an screensaver for Mac OSX / macOS that plays animated GIFs.