aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix/erl_unix_sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/sys/unix/erl_unix_sys.h')
-rw-r--r--erts/emulator/sys/unix/erl_unix_sys.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/erts/emulator/sys/unix/erl_unix_sys.h b/erts/emulator/sys/unix/erl_unix_sys.h
index 303ebeee7c..a14a4b3eae 100644
--- a/erts/emulator/sys/unix/erl_unix_sys.h
+++ b/erts/emulator/sys/unix/erl_unix_sys.h
@@ -161,8 +161,10 @@ typedef struct tms SysTimes;
#if SIZEOF_LONG == 8
typedef long ErtsMonotonicTime;
+typedef long ErtsSysHrTime;
#elif SIZEOF_LONG_LONG == 8
typedef long long ErtsMonotonicTime;
+typedef long long ErtsSysHrTime;
#else
#error No signed 64-bit type found...
#endif
@@ -201,6 +203,7 @@ ErtsMonotonicTime erts_os_monotonic_time(void);
#elif defined(OS_MONOTONIC_TIME_USING_GETHRTIME)
#define erts_os_monotonic() ((ErtsMonotonicTime) gethrtime())
+#define erts_sys_hrtime() ((ErtsSysHrTime) gethrtime())
#elif defined(OS_MONOTONIC_TIME_USING_MACH_CLOCK_GET_TIME) \
|| defined(OS_MONOTONIC_TIME_USING_TIMES)
@@ -221,6 +224,15 @@ ErtsMonotonicTime erts_os_monotonic_time(void);
#endif
+/*
+ * erts_sys_hrtime() is the highest resolution
+ * time function found. Time unit is nano-seconds.
+ * It may or may not be monotonic.
+ */
+#ifndef erts_sys_hrtime
+extern ErtsSysHrTime erts_sys_hrtime(void);
+#endif
+
struct erts_sys_time_read_only_data__ {
#ifdef ERTS_OS_MONOTONIC_INLINE_FUNC_PTR_CALL__
ErtsMonotonicTime (*os_monotonic_time)(void);