Skip to content

Instantly share code, notes, and snippets.

@bobbyjam99-zz
Created May 17, 2019 06:03
Show Gist options
  • Save bobbyjam99-zz/b680b325c0c87a5704bff6c6be41a7de to your computer and use it in GitHub Desktop.
Save bobbyjam99-zz/b680b325c0c87a5704bff6c6be41a7de to your computer and use it in GitHub Desktop.
Long startTime = DateTime.now().getTime();
Long finishTime = DateTime.now().getTime();
while ((finishTime - startTime) < 9000) {
// sleep for 9s
finishTime = DateTime.now().getTime();
}
System.assertEquals(Integer.valueOf((finishTime - startTime) / 1000), 9);
System.debug('>>> Done from ' + startTime + ' to ' + finishTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment