timing

File Purpose: timers, runtime profiling

Functions

print_profile([sortkey])

prints stats from the default profiler (PROFILE).

profiling([sortkey])

returns default profiler, PROFILE.

start_profiling()

equivalent to PROFILE.enable().

stop_profiling()

equivalent to PROFILE.disable().

Classes

Profile(*args[, sortkey, clearing])

runtime profiler.

ProgressUpdater([print_freq, wait, ...])

class for printing messages but only when enough time has passed.

Stopwatch([printing])

tracks time since last clear (via self.reset()), or last "marked" time (via self.mark_time()).

TickingWatch(interval, *[, wait, _t_mark_key])

Stopwatch that also "ticks" every N seconds.

TimeLimit(seconds)

context manager which imposes a time limit, exiting with TimeoutError if internal code takes too long.