⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtime_.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
字号:
/*char id_dtime[] = "@(#)dtime_.c	1.1"; * * Returns the delta time since the last call to dtime. * * calling sequence: * 	real time(2) * 	call dtime(time) * where: * 	the 2 element array time will receive the user and system * 	elapsed time since the last call to dtime, or since the start * 	of execution. * * This routine can be called as function, and returns the sum of * user and system times. The time_array argument must always be given. * * The resolution for all timing is 1/60 second. */#include <sys/types.h>#include <sys/times.h>struct tb { float usrtime; float systime; };time_t dutime=0, dstime=0;floatdtime_(dt) struct tb *dt;{	struct tms clock;	times(&clock);	dt->usrtime = (float)(clock.tms_utime - dutime) / 60.0;	dt->systime = (float)(clock.tms_stime - dstime) / 60.0;	dutime = clock.tms_utime;	dstime = clock.tms_stime;	return(dt->usrtime + dt->systime);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -