>>>>> Thomas Robitaille <thomas.robitai...@gmail.com> (TR) wrote:
>TR> Hi, >TR> I'm making use of the multiprocessing module, and I was wondering if there >TR> is an easy way to find out how long a given process has been running for. >TR> For example, if I do >TR> import multiprocessing as mp >TR> import time >TR> def time_waster(): >TR> time.sleep(1000) >TR> p = mp.Process(target=time_waster) >TR> p.start() >TR> Is there a way that I can then find how long p has been running for? I >TR> figured I can use p.pid to get the PID of the process, but I'm not sure >TR> where to go from there. Is there an easy way to do this? You could look at the psutil module: http://code.google.com/p/psutil/ -- Piet van Oostrum <p...@cs.uu.nl> URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@vanoostrum.org -- http://mail.python.org/mailman/listinfo/python-list