If so it replaces array element and then performs a

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: icating child times give the accumulated times used by children that have terminated and have been reaped. Thus, times cannot be used to monitor the time used by any ongoing children. As a return value, times returns the total number of clock ticks that have elapsed since the system was started. We can therefore compute the total time (in clock ticks) between two different points in a program execution by making two calls to times and computing the difference of the return values. The ANSI C standard also defines a function clock that measures the total time used by the current process: #include <time.h> clock t clock(void); Returns: total time used by process Although the return value is declared to be the same type clock t used with the times function, the two functions do not, in general, express time in the same units. To scale the time reported by clock to seconds, it should be divided by the defined constant CLOCKS PER SEC. This value need not be the same as the constant CLK TCK. 9.2.3 Accuracy of...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online