Last active
May 28, 2019 11:36
-
-
Save vector4wang/4794565923420ede8fab87e76f1ad593 to your computer and use it in GitHub Desktop.
[code timer statistics] #Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Timer t1 = new Timer(); | |
t1.start(); // 针对每一个方法需要 new一个,并且需要制定start()和stop() | |
fun1(); | |
t1.sotp; | |
Timer t2 = new Timer(); | |
t2.start() | |
fun2(); | |
t2.stop(); | |
Timer t3 = new Timer(); | |
t3.start(); | |
fun3(); | |
t3.stop(); | |
Timer.print();// 最后将所有的方法,调用的次数与总耗时打印出来 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment