Skip to content

Instantly share code, notes, and snippets.

@xgeek-net
Created May 14, 2015 08:08
Show Gist options
  • Save xgeek-net/5db74af24c4ee31a3100 to your computer and use it in GitHub Desktop.
Save xgeek-net/5db74af24c4ee31a3100 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