localsub(const time_t * const timep, const long offset, struct tm * const tmp);\r
\r
clock_t\r
-EFIAPI\r
__getCPS(void)\r
{\r
return gMD->ClocksPerSecond;\r
\r
/* ############### Time Manipulation Functions ########################## */\r
\r
-/** The clock function determines the processor time used.\r
-\r
- @return The clock function returns the implementation\92s 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
-EFIAPI\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
-EFIAPI\r
difftime(time_t time1, time_t time0)\r
{\r
return (double)(time1 - time0);\r
return t;\r
}\r
\r
-static time_t\r
+time_t\r
time2(struct tm * const tmp, void (* const funcp)(const time_t*, long, struct tm*),\r
const long offset, int * const okayp)\r
{\r
represented, the function returns the value (time_t)(-1).\r
**/\r
time_t\r
-EFIAPI\r
mktime(struct tm *timeptr)\r
{\r
/* From NetBSD */\r
/** The time function determines the current calendar time. The encoding of\r
the value is unspecified.\r
\r
- @return The time function returns the implementation\92s best approximation\r
+ @return The time function returns the implementation's best approximation\r
to the current calendar time. The value (time_t)(-1) is returned\r
if the calendar time is not available. If timer is not a null\r
pointer, the return value is also assigned to the object it\r
points to.\r
**/\r
time_t\r
-EFIAPI\r
time(time_t *timer)\r
{\r
time_t CalTime;\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
@return The asctime function returns a pointer to the string.\r
**/\r
char *\r
-EFIAPI\r
asctime(const struct tm *timeptr)\r
{\r
register const char * wn;\r
/**\r
**/\r
char *\r
-EFIAPI\r
ctime(const time_t *timer)\r
{\r
return asctime(localtime(timer));\r
/*\r
** gmtsub is to gmtime as localsub is to localtime.\r
*/\r
-static void\r
+void\r
gmtsub(\r
const time_t * const timep,\r
const long offset,\r
/**\r
**/\r
struct tm *\r
-EFIAPI\r
gmtime(const time_t *timer)\r
{\r
gmtsub(timer, 0L, &gMD->BDTime);\r
/**\r
**/\r
struct tm *\r
-EFIAPI\r
localtime(const time_t *timer)\r
{\r
tzset();\r