aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-04-25 17:37:54 +0200
committerPatrik Nyblom <[email protected]>2013-04-25 17:37:54 +0200
commit560226377bc9a732fb3a9c20dde907def56e3d30 (patch)
tree50b6e709ad80899fd8ca5419eda749f8f5a0d6da /erts/emulator/beam/utils.c
parent408a4b2009213e40a6d303fce786aa7bc27c9697 (diff)
downloadotp-560226377bc9a732fb3a9c20dde907def56e3d30.tar.gz
otp-560226377bc9a732fb3a9c20dde907def56e3d30.tar.bz2
otp-560226377bc9a732fb3a9c20dde907def56e3d30.zip
Add long_schedule detection for ports and testcases
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 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!