我想计算windows中任务管理器上运行的进程的运行时间。
如果特定进程在一定时间后运行,我可以结束该进程。
最佳答案
您需要使用时间函数。
//Your start time.
long startTime = System.nanoTime();
//YOUR CALL GOES HERE
//Your end time.
long stopTime = System.nanoTime();
//Take the difference and that is how long it takes to execute your function.
System.out.println(stopTime - startTime);
关于java - 计算进程的运行时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21811588/