| 935 | } |
| 936 | |
| 937 | static BenchmarkTimeStamps get_benchmark_time_stamps(void) |
| 938 | { |
| 939 | BenchmarkTimeStamps time_stamps = { av_gettime_relative() }; |
| 940 | #if HAVE_GETRUSAGE |
| 941 | struct rusage rusage; |
| 942 | |
| 943 | getrusage(RUSAGE_SELF, &rusage); |
| 944 | time_stamps.user_usec = |
| 945 | (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec; |
| 946 | time_stamps.sys_usec = |
| 947 | (rusage.ru_stime.tv_sec * 1000000LL) + rusage.ru_stime.tv_usec; |
| 948 | #elif HAVE_GETPROCESSTIMES |
| 949 | HANDLE proc; |
| 950 | FILETIME c, e, k, u; |
| 951 | proc = GetCurrentProcess(); |
| 952 | GetProcessTimes(proc, &c, &e, &k, &u); |
| 953 | time_stamps.user_usec = |
| 954 | ((int64_t)u.dwHighDateTime << 32 | u.dwLowDateTime) / 10; |
| 955 | time_stamps.sys_usec = |
| 956 | ((int64_t)k.dwHighDateTime << 32 | k.dwLowDateTime) / 10; |
| 957 | #else |
| 958 | time_stamps.user_usec = time_stamps.sys_usec = 0; |
| 959 | #endif |
| 960 | return time_stamps; |
| 961 | } |
| 962 | |
| 963 | static int64_t getmaxrss(void) |
| 964 | { |
no test coverage detected