How to get system time with microsecond Resolution
12
votes
7
answers
56951
views
I want to know current system time with microsecond Resolution.
My Use case: I am recording Videos using multiple Raspberry Pis simulatenously. Now I want to timestamp each frame of videos so that I can align them. Currently for timestamp it's using boot time(time since boot). Boot time is accurate but it's different for each Raspberry Pi. I have configured all Pi's to a NTP Server thus all have same System time. So basically I want the timestamp of System time not Boot Time. How can I do that ?
date +%s
returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying this value? By delay I mean suppose at time t
secs i query and it gives me value t + t'
what is t'
? My Use case: I am recording Videos using multiple Raspberry Pis simulatenously. Now I want to timestamp each frame of videos so that I can align them. Currently for timestamp it's using boot time(time since boot). Boot time is accurate but it's different for each Raspberry Pi. I have configured all Pi's to a NTP Server thus all have same System time. So basically I want the timestamp of System time not Boot Time. How can I do that ?
Asked by Coderaemon
(229 rep)
May 21, 2015, 10:23 AM
Last activity: Jul 11, 2025, 10:46 AM
Last activity: Jul 11, 2025, 10:46 AM