From 4e822a7f89787ff476fec172e57d1aab31a1740b Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 16 Feb 2017 00:54:48 +0200 Subject: Profile CPU time instead. --- glcapture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glcapture.c b/glcapture.c index c6fd494..a38a202 100644 --- a/glcapture.c +++ b/glcapture.c @@ -138,9 +138,9 @@ struct buffer { }; #define PROFILE(x, warn_ms, name) do { \ - const uint64_t start = get_time_ns(); \ + const uint64_t start = get_time_ns_clock(CLOCK_PROCESS_CPUTIME_ID); \ x; \ - const double ms = (get_time_ns() - start) / 1e6; \ + const double ms = (get_time_ns_clock(CLOCK_PROCESS_CPUTIME_ID) - start) / 1e6; \ if (ms >= warn_ms) WARNX("WARNING: %s took %.2f ms (>=%.0fms)", name, ms, warn_ms); \ } while (0) -- cgit v1.2.3-70-g09d2