What is the difference between tms_utime and tms_stime with times () function?

What is the difference between tms_utime and tms_stime exactly? I mean struct tms used by the POSIX times() function. Is data caching time included in utime ? Can I measure data caching time separately?

PS: I am using Linux-Ubuntu. For example, I solve a large allowed system of linear equations using my C ++ program.

0
c ++ cpu
Apr 15 '14 at 21:44
source share
1 answer

Given that you are discussing the members tms_utime and tms_stime struct tms (which contains 4 elements of type clock_t ) used by times() , the difference is what is indicated in my first and last comments:

The tms_utime element is the time it takes to execute your code, or the code in the C library. The tms_stime element is the amount of time it takes to execute the kernel code on your behalf. ( tms_cutime and tms_cstime are the sums of tms_utime and tms_stime respectively for all the child processes that came out - see the rationale comment.)

There is no breakdown of time into "time spent waiting for cache", but "time spent waiting for cache." I think the cache time will be included in the tms_stime value, because when the data is not in the cache, you will need a system to get it for you.

+3
Apr 16 '14 at 1:59
source share



All Articles