Source code for calpit.example_benchmarks
"""An example module containing simplistic methods under benchmarking."""
import random
import time
[docs]
def runtime_computation():
"""Runtime computation consuming between 0 and 5 seconds."""
time.sleep(random.uniform(0, 5))
[docs]
def memory_computation():
"""Memory computation for a random list up to 512 samples."""
return [0] * random.randint(0, 512)