module loghelper.time_helper
¶
Short summary¶
module pyquickhelper.loghelper.time_helper
Helpers around time.
Functions¶
function |
truncated documentation |
---|---|
Runs a function on a regular basis. The function is not multithreaded, it returns when all execution are done. |
|
Runs a python script on a regular basis. The function is not multithreaded, it returns when all execution are done. … |
Documentation¶
Helpers around time.
- 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
- 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