summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Time/Time.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Time/Time.c')
-rw-r--r--StdLib/LibC/Time/Time.c50
1 files changed, 22 insertions, 28 deletions
diff --git a/StdLib/LibC/Time/Time.c b/StdLib/LibC/Time/Time.c
index e3eccb593b..0296a5dc93 100644
--- a/StdLib/LibC/Time/Time.c
+++ b/StdLib/LibC/Time/Time.c
@@ -180,34 +180,6 @@ timesub(
/* ############### Time Manipulation Functions ########################## */
-/** The clock function determines the processor time used.
-
- @return The clock function returns the implementation's best
- approximation to the processor time used by the program since the
- beginning of an implementation-defined era related only to the
- program invocation. To determine the time in seconds, the value
- returned by the clock function should be divided by the value of
- the macro CLOCKS_PER_SEC. If the processor time used is not
- available or its value cannot be represented, the function
- returns the value (clock_t)(-1).
-
- On IA32 or X64 platforms, the value returned is the number of
- CPU TimeStamp Counter ticks since the appliation started.
-**/
-clock_t
-clock(void)
-{
-#ifndef NT32dvm
- clock_t temp;
-
- temp = (clock_t)GetPerformanceCounter();
-
- return temp - gMD->AppStartTime;
-#else
- return (clock_t)-1;
-#endif /* NT32dvm */
-}
-
/**
**/
double
@@ -591,6 +563,28 @@ time(time_t *timer)
return CalTime; // Return calendar time in microseconds
}
+/** The clock function determines the processor time used.
+
+ @return The clock function returns the implementation's best
+ approximation to the processor time used by the program since the
+ beginning of an implementation-defined era related only to the
+ program invocation. To determine the time in seconds, the value
+ returned by the clock function should be divided by the value of
+ the macro CLOCKS_PER_SEC. If the processor time used is not
+ available or its value cannot be represented, the function
+ returns the value (clock_t)(-1).
+**/
+clock_t
+clock(void)
+{
+ clock_t retval;
+ time_t temp;
+
+ temp = time(NULL);
+ retval = ((clock_t)((UINT32)temp)) - gMD->AppStartTime;
+ return retval;
+}
+
/* ################# Time Conversion Functions ########################## */
/*
Except for the strftime function, these functions each return a pointer to