aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-05-02 18:49:45 +0200
committerPatrik Nyblom <[email protected]>2013-05-02 18:49:45 +0200
commit0c1ceeb0a30609a105dd69e000d1c391e2d2927e (patch)
tree71e3b189b1326b59d2564ea7769f6d30acc6327b /erts/emulator/beam/utils.c
parente086819ca3238e7b47e9e417e981cbba8fc3fbc1 (diff)
downloadotp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.tar.gz
otp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.tar.bz2
otp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.zip
Add system_monitor of long_schedule
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c18
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!