0

Running benchmark on my computer Linux Intel(R) Core(TM) i5-4430 CPU @ 3.00GHz. I have a granularity of 36ns and a latency of 37ns for the method System.nanoTime().

I am concerned about where this 36ns is spent, Is it the time for the Operating System to access the registers and get the value of the current time ?

Bionix1441
  • 2,135
  • 1
  • 30
  • 65
  • Why are you concerned about 36 ns? That's 0.000000036 seconds. – aioobe Jun 05 '15 at 11:11
  • 1
    I don't this is a duplicate as I want to know how it works internally, I have already tried debugging with gdb but got no result – Bionix1441 Jun 05 '15 at 11:13
  • You think 108 processor instruction are too much? I don't think there is a time register (as a CPU register), so it's a bit more that accessing EAX or something – Thomas Weller Jun 05 '15 at 11:14
  • I have only found this post about the native implementation de nanotime http://www.javacodegeeks.com/2012/02/what-is-behind-systemnanotime.html – Bionix1441 Jun 05 '15 at 11:17
  • On bigger applications this overhead will be accumulated. – Bionix1441 Jun 05 '15 at 13:36

0 Answers0