其他分享
首页 > 其他分享> > times函数的意义

times函数的意义

作者:互联网

 

 curren_time是tms结构体的实体。

struct tms 
  { 
    clock_t tms_utime ;          /* User CPU time.  用户程序 CPU 时间*/ 
    clock_t tms_stime ;          /* System CPU time. 系统调用所耗费的 CPU 时间 */ 

    clock_t tms_cutime ;         /* User CPU time of dead children. 已死掉子进程的 CPU 时间*/ 
    clock_t tms_cstime ;         /* System CPU time of dead children.  已死掉子进程所耗费的系统调用 CPU 时间*/ 
  };

clock是long的宏。

times给结构体赋值是从开始到现在时钟中断次数。

#define LATCH (1193180/HZ) 宏 HZ 在文件 include/linux/sched.h 的第 5 行定义如下: #define HZ 100 8253定时计数器一秒动1193180下,乘以0.01秒代表时钟中断.

标签:HZ,tms,函数,意义,clock,掉子,times,time,CPU
来源: https://www.cnblogs.com/hahaah/p/14965245.html