I have a time stamper that gives me times in nanos and I want to get millis from nanos. So I am dividing nanos / 1000000. Any fast way to go from nanos to millis without paying the DIV cost, which can be expensive?
Any kind of shift? Maybe I can shift by a number close to 1,000,000 that is a power of 2? That might be a smart trick to do that, because I am giving up the nanos precision to go to millis.
My benchmarks show that it can take anywhere from 0 nanos to 1 millis.
The 99% percentile has an average time of 72 nanos with a max time of 1 micro.
That looks bad.