Mercurial > libavformat.hg
diff utils.c @ 2266:c3d2ed2063a0 libavformat
Move av_gettime() back to lavf/utils.c
author | ramiro |
---|---|
date | Mon, 16 Jul 2007 20:28:43 +0000 |
parents | 3677c1667194 |
children | 7eb456c4ed8a |
line wrap: on
line diff
--- a/utils.c Mon Jul 16 20:27:16 2007 +0000 +++ b/utils.c Mon Jul 16 20:28:43 2007 +0000 @@ -23,6 +23,8 @@ #include "opt.h" #include "avstring.h" #include "riff.h" +#include <sys/time.h> +#include <time.h> #undef NDEBUG #include <assert.h> @@ -2498,6 +2500,16 @@ return ret; } +/** + * gets the current time in micro seconds. + */ +int64_t av_gettime(void) +{ + struct timeval tv; + gettimeofday(&tv,NULL); + return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; +} + int64_t parse_date(const char *datestr, int duration) { const char *p;