Miscellaneous

Time utilities (pymanip.mytime)

This modules contains very simple functions for handling dates and times. In particular, the datestr2epoch() is useful to read fluidlab’s session timestamps which are roughly in RFC 3339 format.

pymanip.mytime.sleep(duration)[source]

Prints a timer for specified duration. This is mostly similar to pymanip.asyncsession.AsyncSession.sleep(), except that it is meant to be used outside a session.

Parameters

duration (float) – the duration for which to sleep

pymanip.mytime.datestr2epoch(string)[source]

Convert datestr into epoch. Correct string is: ‘2016-02-25T17:36+0100’ or ‘2016-02-25T17:36+01:00’.

UTC+1 or UTC+0100 is also accepted by this function Accepts a single string or a list of string

pymanip.mytime.epoch2datestr(epoch, tz=None)[source]

Convert epoch into datestr. If no tz is given, the output is given in Coordinated Universal Time

pymanip.mytime.tic()[source]

Simple timer start.

pymanip.mytime.toc(comment=None)[source]

Simpler timer stop.

Parameters

comment (str, optional) – comment for print