| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This simplifies its use. Previously:
w.start('foo')
...
w.stop('foo')
Now:
with w('foo'):
...
With "with", it is immediately clear from the code,
and its indentation, what is being measured. With
the old code, you have to hunt for the start and stop
method calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function is only available in Python >= 2.7. On
http://docs.python.org/library/datetime.html#timedelta-objects
it says total_seconds() is equal to
(td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
with true division enabled. We are using
td.days * 24 * 3600 +
td.seconds +
operator.truediv(td.microseconds, 10**6)
now in Stopwatch.start_stop_seconds(), which I find more readable.
|
| |
|
| |
|
|
The Stopwatch class does not have unit tests yet and the build times
stored in the cache for system images may be a little too fine-grained
at the moment.
|