aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_lock_count.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-03-23 16:39:56 +0100
committerRickard Green <[email protected]>2015-03-23 17:16:09 +0100
commite52829ceb614b36c31a650dea455a463fc490698 (patch)
tree425d5f2a6286f0545c4f70b12ba94584fd468de5 /erts/emulator/beam/erl_lock_count.c
parentd07319f790eb38c867bd04a23de674e2393825ff (diff)
downloadotp-e52829ceb614b36c31a650dea455a463fc490698.tar.gz
otp-e52829ceb614b36c31a650dea455a463fc490698.tar.bz2
otp-e52829ceb614b36c31a650dea455a463fc490698.zip
erts_sys_hrtime() for lcnt
Diffstat (limited to 'erts/emulator/beam/erl_lock_count.c')
-rw-r--r--erts/emulator/beam/erl_lock_count.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_lock_count.c b/erts/emulator/beam/erl_lock_count.c
index ddeb56a6be..c6d8f4df95 100644
--- a/erts/emulator/beam/erl_lock_count.c
+++ b/erts/emulator/beam/erl_lock_count.c
@@ -104,16 +104,13 @@ static void lcnt_clear_stats(erts_lcnt_lock_stats_t *stats) {
}
static void lcnt_time(erts_lcnt_time_t *time) {
-#if 0 || defined(ERTS_HAVE_OS_MONOTONIC_TIME_SUPPORT)
- ErtsMonotonicTime mtime = ERTS_MONOTONIC_TO_NSEC(erts_os_monotonic_time());
+ /*
+ * erts_sys_hrtime() is the highest resolution
+ * we could find, it may or may not be monotonic...
+ */
+ ErtsMonotonicTime mtime = erts_sys_hrtime();
time->s = (unsigned long) (mtime / 1000000000LL);
time->ns = (unsigned long) (mtime - 1000000000LL*time->s);
-#else
- SysTimeval tv;
- sys_gettimeofday(&tv);
- time->s = tv.tv_sec;
- time->ns = tv.tv_usec*1000LL;
-#endif
}
static void lcnt_time_diff(erts_lcnt_time_t *d, erts_lcnt_time_t *t1, erts_lcnt_time_t *t0) {