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

📄 clock.c

📁 R+树的c实现源码
💻 C
字号:
/*|| clock.c|||| Functions:||	ResetClock()||	StartClock()||	StopClock()*/#include	<sys/types.h>#include	<sys/times.h>#include 	"options.h"#include 	"index.h"struct	tms start, stop, net;extern	float	UserTime, SystemTime;extern	long	ElapsedTime;long	startElapsed, stopElapsed;ResetClock(){	UserTime = SystemTime = 0;	ElapsedTime = 0;	net.tms_utime = net.tms_stime = net.tms_cutime = net.tms_cstime = 0;}StartClock(){	long time();	times(&start);	startElapsed = time(0);}StopClock(){	long time();	times(&stop);	stopElapsed = time(0);	net.tms_utime +=  stop.tms_utime -  start.tms_utime;	net.tms_stime +=  stop.tms_stime -  start.tms_stime;	net.tms_cutime += stop.tms_cutime - start.tms_cutime;	net.tms_cstime += stop.tms_cstime - start.tms_cstime;	UserTime = (float)net.tms_utime / 60;	SystemTime = (float)net.tms_stime / 60;	ElapsedTime += stopElapsed - startElapsed;}

⌨️ 快捷键说明

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