CoCalc Public Filestiming.sagewsOpen with one click!
Author: Harald Schilly
Views : 70
Compute Environment: Ubuntu 18.04 (Deprecated)
log(0.5) / log(999. / 1000)
692.800549178500
692 / 60.
11.5333333333333
import timeit from random import random def time_me(n = 10000): z = 0.0 for i in xrange(n): z += random() - .5 return z timeit.repeat(time_me, repeat = 3, number=10)
[0.22239089012145996, 0.2087249755859375, 0.21767377853393555]
import psutil get_time = lambda : psutil.Process().cpu_times().user t0 = get_time() loops = 100 for x in range(loops): _ = time_me() print (get_time() - t0) / loops
0.0251

0x  dx\int_0^\infty x\; \mathrm{d}x