\r
/* ############### Time Manipulation Functions ########################## */\r
\r
-/** The clock function determines the processor time used.\r
-\r
- @return The clock function returns the implementation's best\r
- approximation to the processor time used by the program since the\r
- beginning of an implementation-defined era related only to the\r
- program invocation. To determine the time in seconds, the value\r
- returned by the clock function should be divided by the value of\r
- the macro CLOCKS_PER_SEC. If the processor time used is not\r
- available or its value cannot be represented, the function\r
- returns the value (clock_t)(-1).\r
-\r
- On IA32 or X64 platforms, the value returned is the number of\r
- CPU TimeStamp Counter ticks since the appliation started.\r
-**/\r
-clock_t\r
-clock(void)\r
-{\r
-#ifndef NT32dvm\r
- clock_t temp;\r
-\r
- temp = (clock_t)GetPerformanceCounter();\r
-\r
- return temp - gMD->AppStartTime;\r
-#else\r
- return (clock_t)-1;\r
-#endif /* NT32dvm */\r
-}\r
-\r
/**\r
**/\r
double\r
return CalTime; // Return calendar time in microseconds\r
}\r
\r
+/** The clock function determines the processor time used.\r
+\r
+ @return The clock function returns the implementation's best\r
+ approximation to the processor time used by the program since the\r
+ beginning of an implementation-defined era related only to the\r
+ program invocation. To determine the time in seconds, the value\r
+ returned by the clock function should be divided by the value of\r
+ the macro CLOCKS_PER_SEC. If the processor time used is not\r
+ available or its value cannot be represented, the function\r
+ returns the value (clock_t)(-1).\r
+**/\r
+clock_t\r
+clock(void)\r
+{\r
+ clock_t retval;\r
+ time_t temp;\r
+\r
+ temp = time(NULL);\r
+ retval = ((clock_t)((UINT32)temp)) - gMD->AppStartTime;\r
+ return retval;\r
+}\r
+\r
/* ################# Time Conversion Functions ########################## */\r
/*\r
Except for the strftime function, these functions each return a pointer to\r