Calculating time difference in Milliseconds

前端 未结 9 543
谎友^
谎友^ 2020-12-04 21:42

I am making a call to a method by passing ipAddress and it will return back the location of ipAddress like Country, City, etc etc. So I was trying to see how much time it is

9条回答
  •  我在风中等你
    2020-12-04 22:09

    Since Java 1.5, you can get a more precise time value with System.nanoTime(), which obviously returns nanoseconds instead.

    There is probably some caching going on in the instances when you get an immediate result.

提交回复
热议问题