Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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