diff options
author | Rickard Green <[email protected]> | 2015-03-23 16:39:56 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-03-23 17:16:09 +0100 |
commit | e52829ceb614b36c31a650dea455a463fc490698 (patch) | |
tree | 425d5f2a6286f0545c4f70b12ba94584fd468de5 /erts/emulator/beam | |
parent | d07319f790eb38c867bd04a23de674e2393825ff (diff) | |
download | otp-e52829ceb614b36c31a650dea455a463fc490698.tar.gz otp-e52829ceb614b36c31a650dea455a463fc490698.tar.bz2 otp-e52829ceb614b36c31a650dea455a463fc490698.zip |
erts_sys_hrtime() for lcnt
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_lock_count.c | 13 | ||||
-rw-r--r-- | erts/emulator/beam/sys.h | 1 |
2 files changed, 5 insertions, 9 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) { diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index d83bdf8d31..c51b665db9 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -708,7 +708,6 @@ extern int erts_init_time_sup(int, ErtsTimeWarpMode); extern void erts_sys_init_float(void); extern void erts_thread_init_float(void); extern void erts_thread_disable_fpe(void); - ERTS_GLB_INLINE int erts_block_fpe(void); ERTS_GLB_INLINE void erts_unblock_fpe(int); |