#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#if _WIN32 || _WIN64
#include <windows.h>
static void sleep_ms(int time) {
    Sleep(time);
}
#else
#include <unistd.h>
static void sleep_ms(int time) {
    usleep(time * 1000);
}
#endif
    const char* dir_path = (const char*)user_data;
    char img_path[256];
    FILE* fd;
    sprintf(img_path, 
"%s/eye_image_%" PRId64 
".gif", dir_path, frame->
device_time_stamp);
    printf("Received image %s\n", img_path);
    fd = fopen(img_path, "wb");
    fclose(fd);
}
    
            eyetracker,
            eye_image_as_gif_callback, (void*)dir_path);
    
    sleep_ms(2000);
    
            eyetracker,
            eye_image_as_gif_callback);
}