Skip to content

Instantly share code, notes, and snippets.

@mgamba
Last active August 29, 2015 13:56
Show Gist options
  • Save mgamba/9263259 to your computer and use it in GitHub Desktop.
Save mgamba/9263259 to your computer and use it in GitHub Desktop.
function to waste cycles
cycles = (wastefulness) ->
t1 = new Date
for x in [0..Math.pow(wastefulness,2)]
Math.pow(Math.random*Math.random)
(new Date) - t1
# >> cycles(100)
# 18
# >> cycles(1000)
# 1371
# >> cycles(2000)
# 5467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment