             decoder.startDecoding();
 
             // Calculate time in the future to terminate animation
-            futureTime = millis() + (DISPLAY_TIME_SECONDS * 1000);
+            futureTime = now + (DISPLAY_TIME_SECONDS * 1000);
         }
 
         // get the index for the next pass through

void loop() {
    static unsigned long futureTime;

#if (START_WITH_RANDOM_GIF == 1)
    static int index = random(num_files);
#else
     static int index = 0;
#endif   

    if(futureTime < millis()) {
        if (openGifFilenameByIndex(GIF_DIRECTORY, index) >= 0) {
            // Can clear screen for new animation here, but this might cause flicker with short animations
            // matrix.fillScreen(COLOR_BLACK);

#include "FilenameFunctions.h"

#define DISPLAY_TIME_SECONDS 10
#define NUMBER_FULL_CYCLES   1

#define USE_SMARTMATRIX         1
#define ENABLE_SCROLLING        1
