times()函式

進程用此函式獲得自己和已終止子進程的牆上時鐘時間,用戶CPU時間和系統CPU時間.返回值clock_t標示經過的牆上時鐘時間.

<sys/times.h>頭檔案中.
原型: clock_t times(struct tms *buf); 正確返回牆上時鐘經過時間, 出錯返回-1 ;
其中參數類型struct tms為:
struct tms
{
clock_t tms_utime; //用戶CPU時間
clock_t tms_stime; //系統CPU時間
clock_t tms_cutime; //以終止子進程的用戶CPU時間
clock_t tms_cstime; //已終止子進程的系統CPU時間
};

相關詞條

熱門詞條

聯絡我們