aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 3e9fe7d..d466bee 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -78,6 +78,13 @@ namespace QuickMedia {
return time_str;
}
+ int64_t get_boottime_milliseconds() {
+ struct timespec time;
+ if(clock_gettime(CLOCK_BOOTTIME, &time) == -1 && errno == EINVAL)
+ clock_gettime(CLOCK_MONOTONIC, &time);
+ return (int64_t)time.tv_sec * 1000 + (int64_t)time.tv_nsec / 1000000;
+ }
+
sf::Vector2f vec2f_floor(float x, float y) {
return sf::Vector2f(int(x), int(y));
}