Last active
October 9, 2020 21:25
-
-
Save naufalafif/a1a365dd32034e51033df2dce54bf12f 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
import time | |
def fake_heavy_computation(value): | |
""" function ini mensimulasikan komputasi berat""" | |
time.sleep(2) # menunggu 2 detik untuk lanjut ke statement berikutnya | |
return value | |
start_time = time.time() | |
fake_heavy_computation(2) | |
print(f"selesai dalam {(time.time()-start_time)} detik") | |
# selesai dalam 2.002336025238037 detik |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment