diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2007-07-13 16:11:36 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2007-07-13 16:11:36 +0000 |
commit | 7495c3066d7b67bbc74b1d5565684ff48e430099 (patch) | |
tree | 041793f25337aae16a21e37157ae8bc50efcd1c8 /ffmpeg.c | |
parent | 7829950cf26af4605f2acff0f076f4c8866f6e57 (diff) | |
download | ffmpeg-7495c3066d7b67bbc74b1d5565684ff48e430099.tar.gz |
Check for GetProcessTimes and use it in getutime
Originally committed as revision 9629 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -34,6 +34,10 @@ #include "fifo.h" #include "avstring.h" +#if !defined(HAVE_GETRUSAGE) && defined(HAVE_GETPROCESSTIMES) +#include <windows.h> +#endif + #if defined(HAVE_TERMIOS_H) #include <unistd.h> #include <fcntl.h> @@ -3112,7 +3116,13 @@ static int64_t getutime(void) getrusage(RUSAGE_SELF, &rusage); return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec; -#elif defined(__MINGW32__) +#elif defined(HAVE_GETPROCESSTIMES) + HANDLE proc; + FILETIME c, e, k, u; + proc = GetCurrentProcess(); + GetProcessTimes(proc, &c, &e, &k, &u); + return ((int64_t) u.dwHighDateTime << 32 | u.dwLowDateTime) / 10; +#else return av_gettime(); #endif } |