Me when I use a uint64_t to represent time in my application
Conversation
Notices
-
Embed this notice
mcc (mcc@mastodon.social)'s status on Friday, 15-Mar-2024 12:44:44 JST mcc - clacke likes this.
-
Embed this notice
✧✦✶✷Catherine✷✶✦✧ (whitequark@mastodon.social)'s status on Friday, 15-Mar-2024 12:44:51 JST ✧✦✶✷Catherine✷✶✦✧ @mcc but is it seconds? nanoseconds? femtoseconds?
in CXXRTL i use single femtoseconds as the timebase and boy, does 64-bit time look short when you do that
(I ended up having a 128-bit cxxrtl::time that is converted to 64.64 fixed point when communicating to other applications)
clacke likes this. -
Embed this notice
mcc (mcc@mastodon.social)'s status on Friday, 15-Mar-2024 12:44:55 JST mcc @whitequark I actually worked this out and in order for a program launched in 2023 and tracking time in a 64-bit variable to create a problem in 3193, the time unit would have to be "ticks" of 4 nanoseconds. Additionally, you would need somewhere to cast the to an int64_t or otherwise subtract it in such a way the highest bit is assumed unset.
-
Embed this notice
Richard Hendricks (hendric@astronomy.city)'s status on Friday, 15-Mar-2024 12:44:55 JST Richard Hendricks @mcc @whitequark ...pulls out my proposal to use 256 bit timers with Planck time ticks of 5e-44 s - good for 35 thousand trillion years!
clacke likes this. -
Embed this notice
Farce Majeure (vathpela@better.boston)'s status on Friday, 15-Mar-2024 12:45:00 JST Farce Majeure @mcc @whitequark ... Which sounds ridiculous, but the part of me that knows FAT filesystems have 2 second granularity knows someone will do it.
clacke likes this. -
Embed this notice
Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Friday, 15-Mar-2024 12:45:07 JST Tom Forsyth @mcc @whitequark Highly recommend you take a look at (and then steal) the NTP format:
https://en.wikipedia.org/wiki/Network_Time_ProtocolThey also have a 128-bit version that seems... adequate:
"enough to resolve the amount of time it takes a photon to pass an electron at the speed of light. [...] enough to provide unambiguous time representation until the universe goes dim."
clacke likes this. -
Embed this notice
mcc (mcc@mastodon.social)'s status on Friday, 15-Mar-2024 12:45:13 JST mcc Do this
clacke likes this.