1 /* 2 * COPYRIGHT: LGPL, See LGPL.txt in the top level directory 3 * PROJECT: ReactOS CRT library 4 * FILE: lib/sdk/crt/time/clock.c 5 * PURPOSE: Implementation of clock() 6 * PROGRAMER: Timo Kreuzer 7 */ 8 #include <precomp.h> 9 10 ULARGE_INTEGER g_StartupTime; 11 12 void initclock(void)13initclock(void) 14 { 15 GetSystemTimeAsFileTime((FILETIME*)&g_StartupTime); 16 } 17 18 /****************************************************************************** 19 * \name clock 20 * \brief Returns the current process's elapsed time. 21 */ 22 clock_t clock(void)23clock(void) 24 { 25 ULARGE_INTEGER Time; 26 27 GetSystemTimeAsFileTime((FILETIME*)&Time); 28 Time.QuadPart -= g_StartupTime.QuadPart; 29 return (clock_t)FileTimeToUnixTime((FILETIME*)&Time, NULL); 30 }; 31