Skip to content

Instantly share code, notes, and snippets.

@Rperry2174
Created January 25, 2021 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rperry2174/06fcc0c4566b0e32eed4c6bbaaaf6c80 to your computer and use it in GitHub Desktop.
Save Rperry2174/06fcc0c4566b0e32eed4c6bbaaaf6c80 to your computer and use it in GitHub Desktop.
# where each iteration simulates CPU time
def work(n):
i = 0
while i < n:
i += 1
# This would simulate a CPU running for 7.5 seconds
def foo():
work(75000)
# This would simulate a CPU running for 2.5 seconds
def bar():
work(25000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment