module loghelper.time_helper

Short summary

module pyquickhelper.loghelper.time_helper

Helpers around time.

source on GitHub

Functions

function

truncated documentation

repeat_execution

Runs a function on a regular basis. The function is not multithreaded, it returns when all execution are done.

repeat_script_execution

Runs a python script on a regular basis. The function is not multithreaded, it returns when all execution are done. …

Documentation

Helpers around time.

source on GitHub

pyquickhelper.loghelper.time_helper.repeat_execution(fct, every_second=1, stop_after_second=5, verbose=0, fLOG=None, exc=True)[source]

Runs a function on a regular basis. The function is not multithreaded, it returns when all execution are done.

Parameters:
  • fct – function to run

  • every_second – every second

  • stop_after_second – stop after a given time or never if None

  • verbose – prints out every execution

  • fLOG – logging function

  • exc – if False, catch exception, else does not catch them

Returns:

results of the function if stop_after_second is not None

source on GitHub

pyquickhelper.loghelper.time_helper.repeat_script_execution(script, every_second=1, stop_after_second=5, outfile=None, errfile=None, verbose=0, fLOG=None, exc=True)[source]

Runs a python script on a regular basis. The function is not multithreaded, it returns when all execution are done.

Parameters:
  • script – script to run

  • every_second – every second

  • stop_after_second – stop after a given time or never if None

  • outfile – file which receives the standard output

  • errfile – file which receives the standard error

  • verbose – prints out every execution

  • fLOG – logging function

  • exc – if False, catch exception, else does not catch them

Returns:

all outputs if stop_after_second is not None

source on GitHub