time.time()

Bart Nessux bart_nessux at hotmail.com
Sat Jan 24 16:25:01 EST 2004


Terry Carroll wrote:

> It sounds like you're thinking time.time() does something else, which
> you're trying to do.  What is that?  There might be another function for
> you.

I should have been more clear... here's the code:

x = time.time()
fp = os.popen("some_process", "r")
fp.read()
fp.close()
print (time.time()-x/60)/60

If fp runs for many hours (in my case it does), I want time.time() to 
return the time it runs in seconds which I would then divide by 60 to 
get the total amount of minutes which I would then divide by 60 to get 
the total amount of hours that the process has ran... does that make 
sense? I don't need to be super precise, just within 1 minute or so of 
the actual amount of time that the process required to run.




More information about the Python-list mailing list