Hi,
I have tried to get the milliseconds in LCB, but failed every atempt.
How do I get milliseconds or seconds in the best way?
Best Regards
Peter
Getting time (milliseconds) in LCB
-
Emily-Elizabeth
- Posts: 239
- Joined: Mon Jan 03, 2022 7:10 pm
- Contact:
Re: Getting time (milliseconds) in LCB
You'd have to do some math, but looks like there is a function to get the seconds from the epoch
https://docs.livecode.com/docs/LiveCode ... versalTime
https://docs.livecode.com/docs/LiveCode ... versalTime
-
victoriasmith
- Posts: 2
- Joined: Sun Nov 08, 2026 10:06 am
Re: Getting time (milliseconds) in LCB
Peter, the epoch-seconds function is the practical starting point. Multiply the returned seconds by 1000 for milliseconds; for higher precision you'll need to combine it with a sub-second timer and do the arithmetic yourself, since the function alone won't give fractional milliseconds. Keep the multiplication explicit so it's clear where the conversion happens. If you only need elapsed time rather than a wall-clock timestamp, a timer is usually a simpler and more reliable choice than working from epoch values.