Calculating time difference in Milliseconds

前端 未结 9 513
谎友^
谎友^ 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:22

    You can use System.nanoTime();

    To get the result in readable format, use TimeUnit.MILLISECONDS or NANOSECONDS

提交回复
热议问题