99 init_logging() - convenience function for setting up logging to file and
1010 to the screen.
1111
12- Timer - a convenience wrapper around the time.time () function from the
12+ Timer - a convenience wrapper around the time.perf_counter () function from the
1313 standard library.
1414
1515:copyright: Copyright 2006-2021 by the PyNN team, see AUTHORS.
@@ -240,7 +240,7 @@ def __init__(self):
240240
241241 def start (self ):
242242 """Start/restart timing."""
243- self ._start_time = time .time ()
243+ self ._start_time = time .perf_counter ()
244244 self ._last_check = self ._start_time
245245
246246 def elapsed_time (self , format = None ):
@@ -255,7 +255,7 @@ def elapsed_time(self, format=None):
255255 >>> timer.elapsed_time(format='long')
256256 16 minutes, 27 seconds
257257 """
258- current_time = time .time ()
258+ current_time = time .perf_counter ()
259259 elapsed_time = current_time - self ._start_time
260260 if format == 'long' :
261261 elapsed_time = Timer .time_in_words (elapsed_time )
@@ -278,7 +278,7 @@ def diff(self, format=None): # I think delta() would be a better name for this
278278 If called with ``format='long'``, return a text representation of the
279279 time.
280280 """
281- current_time = time .time ()
281+ current_time = time .perf_counter ()
282282 time_since_last_check = current_time - self ._last_check
283283 self ._last_check = current_time
284284 if format == 'long' :
0 commit comments