Last active
August 29, 2015 14:28
-
-
Save ufechner7/d264fb714a551d333e6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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