Measuring very short execution times has some pitfalls that can be avoided with the help of the timeit Python module. Sometimes one might be interested in measuring the performance of a very small bit ...
"#so we use a for loop \n", "\"-\".join(str(n) for n in range(1,100))\n", "#we have to calculate the time to create this string\n", "timeit.timeit('\"-\".join(str(n ...