diff options
author | Erlang/OTP <[email protected]> | 2013-04-26 12:33:20 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2013-04-26 12:33:20 +0200 |
commit | bfc0387a40097414f5e1af11d01ec621296cc33f (patch) | |
tree | 3bbfb75ecf0bf3c726cf1683650bce5b71aa6940 /erts/emulator/beam/utils.c | |
parent | 32b32fb6dd9e4c501c434789625e270e437960e3 (diff) | |
parent | c599f85af779db465348f0413f9ff245d741d699 (diff) | |
download | otp-bfc0387a40097414f5e1af11d01ec621296cc33f.tar.gz otp-bfc0387a40097414f5e1af11d01ec621296cc33f.tar.bz2 otp-bfc0387a40097414f5e1af11d01ec621296cc33f.zip |
Merge branch 'pan/monitor_long_schedule' into maint-r15
* pan/monitor_long_schedule:
Skip testcase on platforms w/o pipes/usleep
Add documentation for new system_monitor
Add long_schedule detection for ports and testcases
Add erlang:system_monitor(Pid,[{long_schedule,Millis}])
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 bd708ceee6..9e8b1086d4 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -3436,6 +3436,24 @@ void erts_silence_warn_unused_result(long unused) } +/* + * 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! |