Created
January 9, 2018 14:20
-
-
Save Wadeck/1ffc61d83d7ee858ede4f72c3d49120e to your computer and use it in GitHub Desktop.
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
@CompileStatic | |
class NanoStaticGroovy { | |
static void main(String[] args) throws Exception { | |
// avoid warmup problems | |
for (int i = 0; i < 500; i++) { | |
System.nanoTime() | |
} | |
final int NUM = 100000 | |
long[] times = new long[NUM] | |
for (int i = 0; i < NUM; i++) { | |
times[i] = System.nanoTime() | |
} | |
for (int i = 0; i < NUM; i++) { | |
println times[i] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment