neurotools.util.time module

Helper functions associated with time

neurotools.util.time.current_milli_time()[source]

Returns the time in milliseconds

neurotools.util.time.today()[source]
Returns:

`string`

Return type:

the date in YYMMDD format

neurotools.util.time.now()[source]

Current date and time as a %Y%m%d_%H%M%S formatted string

neurotools.util.time.tic(doprint=True, prefix='')[source]

Similar to Matlab tic stackoverflow.com/questions/5849800/tic-toc-functions-analog-in-python

Parameters:

doprint (bool) – if True, print elapsed time. Else, return it.

Returns:

tcurrent_milli_time()

Return type:

int

neurotools.util.time.toc(doprint=True, prefix='')[source]

Similar to Matlab toc stackoverflow.com/questions/5849800/tic-toc-functions-analog-in-python

Parameters:
  • doprint (bool) – if True, print elapsed time. Else, return it.

  • prefix (str)

Returns:

  • t (number) – Current timestamp

  • dt (number) – Time since the last call to the tic() or toc() function.

neurotools.util.time.waitfor(t)[source]

Spin-wait for t milliseconds.

Parameters:

t (posive number)

neurotools.util.time.outputlimiter(callback, ms=1000)[source]

Limit output to no more than once per second.