On 24 July 2012 11:18, Albert-Jan Roskam <fo...@yahoo.com> wrote: > I would like to test how long it takes for two versions of the same > program to start up and be ready to receive commands. The program is SPSS > version-very-old vs. SPSS version-latest. > > Normally I'd just fire the program up in a subprocess and measure the time > before and after finishing. But this kind of program is never finished. > It's looping until infinity and waiting for events/commands. I tried > wrapping it in a "while True" loop, and break out of the loop and terminate > the program (using ctypes) if the retcode of the process is equal to zero. > But that doesn't work. >
So, the question is, what defines your end point for timing. I'd say, you could either check if the program *looks* like being ready ( http://sikuli.org/ could help here) or if it doesn't use up cpu anymore. Both ways, I'd except a fair amount of overhead and for the cpu-usage way bogus results also. Both problems could perhaps be addressed by enough timing runs. cu, Michael
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor