I want to keep track of the last time my python program printed something to the console.
I created this function:
def updateLastPrintTime():
global lastPrintTime
lastPrintTime = time.time()
And I'm calling it after each print statement.
This works fine, however, I have a lot of print statements and I want to update lastPrintTime
after each and every printing.
If print
was not a built in function, this is what I would do:
def print():
updateLastPrintTime()
# rest of 'print' code ...
But I can't figure out how to do that with a built-in function, especially since they are written in C. Any help would be appreciated.