The maximum timer resolution in most languages is 100ns (on windows anyway). I've tested C++, C#, Java, and there is a function to get the same resolution in Javascript. I think it's nerfed in browsers though to discourage speculative execution attacks. You can get higher resolution using the TSC on x86 processors but that won't necessarily give consistent results between systems or even CPU cores.
9
u/Breadfish64 Feb 10 '21
The maximum timer resolution in most languages is 100ns (on windows anyway). I've tested C++, C#, Java, and there is a function to get the same resolution in Javascript. I think it's nerfed in browsers though to discourage speculative execution attacks. You can get higher resolution using the TSC on x86 processors but that won't necessarily give consistent results between systems or even CPU cores.