Skip to content

Instantly share code, notes, and snippets.

@ufechner7
Last active August 29, 2015 14:28
Show Gist options
  • Save ufechner7/d264fb714a551d333e6b to your computer and use it in GitHub Desktop.
Save ufechner7/d264fb714a551d333e6b to your computer and use it in GitHub Desktop.
function check_sleep(amount)
start = time()
sleep(amount)
final = time()
delta = final - start
return delta
end
sum = 0.0
abs(check_sleep(0.020)-0.020) # precompile check_sleep
for i in 1:100
sum += abs(check_sleep(0.020)-0.020)
end
error = 10 * sum
println("Average error is $error ms.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment