3 ms·
In the python example you're running a function, while in the grep example you're launching a program (grep) from your shell. To make the comparison more fair
by jbnicolai 11y ago
In the python example you're running a function, while in the grep example you're launching a program (grep) from your shell.
To make the comparison more fair you'd store the python program and time starting and running both from a shell.