You are not logged in.
Pages: 1
I am a high school student doing a science fair project where I compare the speeds of various programming languages doing specified tasks. I was planning to use the time command to monitor how much cpu time my programs were using, thus eliminating any influence from other programs (in theory anyway). The one thing that confuses me is the difference between user cpu time and system cpu time. These are mentioned everywhere, but never really explained. What's the difference?
EDIT: Fixing typos from the crap keyboard I'm using
Offline
real time is the wallclock time, i.e. the time you wait for the task to complete.
user time is the time needed for the task to be executed by the cpu.
system time is the time spent on doing system calls like reading/writing to the hard drive or if your task is doing illegal operations like division by zero. So usually the system time is much less than the user time.
Probably the user time is the one that you're interested in here as I assume that the system time won't change much from language to language.
Offline
So the system time would include things like loading interpreters, etc?
That would kinda fit with what I'm getting.
Thanks, my results make a lot more sense now.
This also explains why the results change when I run the program twice without rebooting. The user time would stay the same, but the system time would change drastically because everything would still be in memory... probably anyway...
Offline
Pages: 1