I've got a .py file that has loops through a bash script like so:
while True:
text = "app cli -- some parameters -- email, password and body for a message"
os.system(text)
I run it from bash and I can only stop this constantly sending out messages by typing in kill -9 pid in bash
and my question is, how could I log start and end time (end time meaning when I killed the process) and the amount of messages/loops (frequency) when I start it as a script and end it from bash.. would I have to adjust my python script or would I have to adjust my command at time of running? and how?
I'm also sure there is a more elegant way of doing what I'm trying to do, I'm just a beginner..
The only thing I managed to do was time how long it took to send out one message at a time.. and that doesn't really help..