diff options
author | Patrik Nyblom <[email protected]> | 2013-06-05 15:58:37 +0200 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2013-06-05 15:58:37 +0200 |
commit | e9b0b2a035f3ca51c9e792a7b3c7c036b72e6816 (patch) | |
tree | 85311be5c695d5aea5602bb5ba6f8308b3e4b69e /erts/emulator/beam/utils.c | |
parent | a7f0387da9aa6cf469a02caf071e20120d3bad87 (diff) | |
parent | c6fe4731a9093166ff41d16900d22808b5a68053 (diff) | |
download | otp-e9b0b2a035f3ca51c9e792a7b3c7c036b72e6816.tar.gz otp-e9b0b2a035f3ca51c9e792a7b3c7c036b72e6816.tar.bz2 otp-e9b0b2a035f3ca51c9e792a7b3c7c036b72e6816.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r-- | erts/emulator/beam/utils.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index d5d97d748a..0a833f7e66 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -3722,6 +3722,24 @@ erts_smp_ensure_later_interval_acqb(erts_interval_t *icp, Uint64 ic) } +/* + * A millisecond timestamp without time correction where there's no hrtime + * - for tracing on "long" things... + */ +Uint64 erts_timestamp_millis(void) +{ +#ifdef HAVE_GETHRTIME + return (Uint64) (sys_gethrtime() / 1000000); +#else + Uint64 res; + SysTimeval tv; + sys_gettimeofday(&tv); + res = (Uint64) tv.tv_sec*1000000; + res += (Uint64) tv.tv_usec; + return (res / 1000); +#endif +} + #ifdef DEBUG /* * Handy functions when using a debugger - don't use in the code! |