aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index 7c492bcb..ae1fe443 100644
--- a/common/util.c
+++ b/common/util.c
@@ -141,3 +141,9 @@ bool sway_set_cloexec(int fd, bool cloexec) {
}
return true;
}
+
+uint32_t get_current_time_in_msec(void) {
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ return now.tv_sec * 1000 + now.tv_nsec / 1000000;
+}