Current timestamp with microsecond precision

I’m recording events arriving over the network and would like a little more precision than milliseconds. Dates.now() only provides a milliscond timestamp. Has anyone already written a function to wrap the Linux system call for a timestamp with microsecond precision?

You can use time() to get the system time in seconds (with high precision)

1 Like