I would like to add a code snippet, and I would like just CPU runtime (ignoring operating system processes, etc.).
I tried time.clock (), it seems too inaccurate and gives a different answer each time. (In theory, of course, if I run it again for the same piece of code, should it return the same value?)
I played with a timeout for about an hour. In fact, what kills it for me is the installation process, I have to import about 20 functions that are impractical, because I almost simply rewrite my code in the settings section to try to use it.
Cprofiles look more attractive, but do they return CPU time? also, a minor point - it displays too much information. Is there a way to get the output in txt or .dat file so that I can read it?
Greetings
OS: Ubuntu program: python 2.7
source
share