int64_t av_gettime(void){#if HAVE_GETTIMEOFDAY/*
linux下的方法
获取的是从1970.1.1到现在的时间,微妙级返回值
*/struct timeval tv;gettimeofday(&tv,NULL);return(int64_t)tv.tv_sec *1000000+ tv.tv_usec;#elif HAVE_GETSYSTEMTIMEASFILETIME/*
windows下,获取utc时间,返回的是us级
*/
FILETIME ft;
int64_t t;GetSystemTimeAsFileTime(&ft);
t =(int64_t)ft.dwHighDateTime <<32| ft.dwLowDateTime;return t /10-11644473600000000;/* Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC时间). */#elsereturn-1;#endif}