1TIMES(3) 386BSD Programmer's Manual TIMES(3) 2 3NNAAMMEE 4 ttiimmeess - process times 5 6SSYYNNOOPPSSIISS 7 ##iinncclluuddee <<ssyyss//ttiimmeess..hh>> 8 9 _c_l_o_c_k__t 10 ttiimmeess(_s_t_r_u_c_t _t_m_s *_t_p) 11 12DDEESSCCRRIIPPTTIIOONN 13 TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ggeettrruussaaggee((22)) aanndd ggeettttiimmeeooffddaayy((33)).. 14 15 The ttiimmeess() function returns the value of time in CLK_TCK's of a second 16 since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated 17 Universal Time. 18 19 It also fills in the structure pointed to by _t_p with time-accounting 20 information. 21 22 The _t_m_s structure is defined as follows: 23 24 typedef struct { 25 clock_t tms_utime; 26 clock_t tms_stime; 27 clock_t tms_cutime; 28 clock_t tms_cstime; 29 } 30 31 The elements of this structure are defined as follows: 32 33 _t_m_s__u_t_i_m_e The CPU time charged for the execution of user instructions. 34 35 _t_m_s__s_t_i_m_e The CPU time charged for execution by the system on behalf of 36 the process. 37 38 _t_m_s__c_u_t_i_m_e The sum of the _t_m_s__u_t_i_m_e _s and _t_m_s__c_u_t_i_m_e _s of the child 39 processes. 40 41 _t_m_s__c_s_t_i_m_e The sum of the _t_m_s__s_t_i_m_es and _t_m_s__c_s_t_i_m_es of the child 42 processes. 43 44 All times are in CLK_TCK's of a second. 45 46 The times of a terminated child process are included in the _t_m_s__c_u_t_i_m_e 47 and _t_m_s__c_s_t_i_m_e elements of the parent when one of the wait(2) functions 48 returns the process ID of the terminated child to the parent. If an 49 error occurs, ttiimmeess() returns the value ((clock_t)-1), and sets errno to 50 indicate the error. 51 52EERRRROORRSS 53 The ttiimmeess() function may fail and set the global variable _e_r_r_n_o for any 54 of the errors specified for the library routines getrusage(2) and 55 gettimeofday(2). 56 57SSEEEE AALLSSOO 58 time(1), getrusage(2), gettimeofday(2), wait(2) 59 60SSTTAANNDDAARRDDSS 61 The ttiimmeess() function conforms to IEEE Std1003.1-1988 (``POSIX''). 62 634th Berkeley Distribution April 19, 1991 1 64 65 66 67