31 static char buffer[20];
43 sprintf(buffer,
"%02d:%02d:%02.3f", h, m, s);
57# if defined(__rtems__)
65static struct timespec delapsedStart;
66static short delapsedStartInitialized = 0;
74 clock_gettime(CLOCK_REALTIME, &delapsedStart);
75 delapsedStartInitialized = 1;
78static double delapsed_start = 0;
94 struct timespec delapsedNow;
95 if (!delapsedStartInitialized)
97 clock_gettime(CLOCK_REALTIME, &delapsedNow);
98 return (
double)(delapsedNow.tv_sec - delapsedStart.tv_sec) +
99 (delapsedNow.tv_nsec - delapsedStart.tv_nsec)/1e9;
101 static long delapsed_start = -1;
102 if (delapsed_start == -1) {
103 delapsed_start = time(0);
106 return time(0) - delapsed_start;
118 return (
long)((clock() * 100.0) / CLOCKS_PER_SEC);
148# if defined(linux) && !defined(__powerpc__)
150# include <sys/types.h>
163 static short first = 1;
164 static char proc[100];
168 sprintf(proc,
"/proc/%ld/statm", (
long)getpid());
171 if (!(fp = fopen(proc,
"r"))) {
172 perror(
"fopen failed in memory_count()");
175 if (fscanf(fp,
"%ld", &size1) != 1) {
176 perror(
"fscanf failed in memory_count()");
long page_faults()
Retrieves the number of page faults since the last initialization.
long cpu_time()
Retrieves the CPU time used since the last initialization.
double delapsed_time(void)
Calculates the elapsed clock time since the last initialization as a numerical value.