Amelio Vazquez-Reina
Amelio Vazquez-Reina

Reputation: 96448

%timeit statement1; statement2;

In IPython, when working with the magic %timeit does

%timeit statement1; statement2;

measure statement1 or statement1 and statement2 together (sequentially)? I would like to measure the latter.

Upvotes: 0

Views: 133

Answers (1)

chepner
chepner

Reputation: 532303

Both statements. You can confirm using the sleep function from the time module:

In [4]: %timeit time.sleep(1); time.sleep(5)
1 loops, best of 3: 6 s per loop

Upvotes: 3

Related Questions