comparison src/core/time.cc @ 202:71832ffe425a

animia: re-add kvm fd source this is all being merged from my wildly out-of-date laptop. SORRY! in other news, I edited the CI file to install the wayland client as well, so the linux CI build might finally get wayland stuff.
author Paper <paper@paper.us.eu.org>
date Tue, 02 Jan 2024 06:05:06 -0500
parents 168382a89b21
children 7cf53145de11
comparison
equal deleted inserted replaced
201:8f6f8dd2eb23 202:71832ffe425a
54 int64_t Duration::InDays() { 54 int64_t Duration::InDays() {
55 return std::llround(static_cast<double>(length) / 86400.0); 55 return std::llround(static_cast<double>(length) / 86400.0);
56 } 56 }
57 57
58 int64_t GetSystemTime() { 58 int64_t GetSystemTime() {
59 assert(sizeof(int64_t) >= sizeof(time_t)); 59 static_assert(sizeof(int64_t) >= sizeof(time_t));
60 time_t t = std::time(nullptr); 60 time_t t = std::time(nullptr);
61 return *reinterpret_cast<int64_t*>(&t); 61 return *reinterpret_cast<int64_t*>(&t);
62 } 62 }
63 63
64 } // namespace Time 64 } // namespace Time