Questions tagged «timeunit»

7
如何使用TimeUnit枚举将纳秒转换为秒?
如何将值从纳秒转换为秒? 这是代码段: import java.io.*; import java.util.concurrent.*; .. class Stamper { public static void main (String[] args) { long start = System.nanoTime(); //some try with nested loops long end = System.nanoTime(); long elapsedTime = end - start; System.out.println("elapsed: " + elapsedTime + "nano seconds\n"); //convert to seconds TimeUnit seconds = new …
145 java  timeunit 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.