fork download
  1. import time
  2. def test(x):
  3. t1 = time.perf_counter()
  4. a = 0
  5. for i in range(x):
  6. a += 1
  7. t2 = time.perf_counter()
  8. print("Time for {} was {}".format(x, t2 - t1))
  9. return x
  10.  
  11. print(test(10000000))
Success #stdin #stdout 0.56s 14120KB
stdin
Standard input is empty
stdout
Time for 10000000 was 0.49095310270786285
10000000