Skip to content

Instantly share code, notes, and snippets.

@naufalafif
Last active October 9, 2020 22:14
Show Gist options
  • Save naufalafif/fdc73c6266a978c9246043f239e00f04 to your computer and use it in GitHub Desktop.
Save naufalafif/fdc73c6266a978c9246043f239e00f04 to your computer and use it in GitHub Desktop.
import functools
@functools.lru_cache
def fake_heavy_computation(value):
""" function ini mensimulasikan komputasi berat"""
time.sleep(2) # menunggu 2 detik untuk lanjut ke statement berikutnya
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment