aboutsummaryrefslogtreecommitdiff
path: root/common/util.c
diff options
context:
space:
mode:
authorhwsmm <9151706+hwsmm@users.noreply.github.com>2025-06-16 00:41:19 +0900
committerKenny Levinsen <kl@kl.wtf>2025-06-16 11:26:26 +0200
commit4b15b3427fd0835247d0a2e188c00f1d2aa04484 (patch)
treeeb1ba6fc19fc687f097957ab9039e5f4d37d8cd3 /common/util.c
parent17f7c1b7820e4f85913ec70ab3c76f238c15c54c (diff)
Rename get_current_time_msec to get_current_time_in_msec and move to util.c
get_current_time_msec conflicts with a function with the same name in wlroots.
Diffstat (limited to 'common/util.c')
-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;
+}