summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-02-16 00:54:48 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2017-02-16 00:54:48 +0200
commit4e822a7f89787ff476fec172e57d1aab31a1740b (patch)
treecbead04e42f4e2c6e2faeb31ac81cb5fb359da8e
parenta148ccbd6a8b6df3e7e7e4780820ef391e6a4e17 (diff)
Profile CPU time instead.
-rw-r--r--glcapture.c4
1 files 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)