I want to use shell to get epoch time and later use javascript on a html page to get another epoch time and then get the difference between them but I'm afraid that the epoch time may not be synchronized among different scripts so this difference is useless
so I want to know, if at the very same time, I use shell and javascript to get epoch tiem will the result be the same or not? if not, how big is the difference?
thanks!
If you mean number of seconds since Unix epoch (1970-01-01T00:00:00Z), it is governed by this very definition. The only differences you should be able to see are caused by:
and possibly also:
Depending on the time resolution you need, some of these are not a problem. My guess is, that if you don't need granularity finer than 1s, you should be more than fine (on the same machine).
*) also note, that on single core system, you can't really get the same time (at least with the ns resolution) from different syscalls, unless the kernel caches it, simply because they have to happen one after another.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With