Skip to content

Instantly share code, notes, and snippets.

@Shounaks
Created April 10, 2024 16:23
Show Gist options
  • Save Shounaks/6761c83fa765739ccda0c5488b27488c to your computer and use it in GitHub Desktop.
Save Shounaks/6761c83fa765739ccda0c5488b27488c to your computer and use it in GitHub Desktop.
Calculating Elapsed Time in NanoSeconds
int[] original = new int[]{1,3,5,7,9,12,15,18,21,24,27,30};
long startTime = System.nanoTime();
System.arraycopy(original,0,copy2,original.length);
System.out.println("arraycopy: %10d ns%n",System.nanoTime() - startTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment