?? t_stamp.c
字號:
/*** $Id: t_stamp.c,v 1.1 2001/04/19 00:03:08 rosinski Exp $*/#include <sys/time.h> /* gettimeofday */ #include <sys/times.h> /* times */#include <unistd.h> /* gettimeofday */#include "gpt.h"/*** t_stamp: Compute timestamp of usr, sys, and wallclock time (seconds)**** Output arguments:** wall: wallclock** usr: user time** sys: system time**** Return value: 0 (success) or -1 (failure)*/int t_stamp (double *wall, double *usr, double *sys){ struct timeval tp; /* argument to gettimeofday */ struct tms buf; /* argument to times */ *usr = 0; *sys = 0; if (times (&buf) == -1) return t_error ("t_stamp: times() failed. Timing bogus\n"); *usr = buf.tms_utime / (double) ticks_per_sec; *sys = buf.tms_stime / (double) ticks_per_sec; gettimeofday (&tp, NULL); *wall = tp.tv_sec + 1.e-6*tp.tv_usec; return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -