[wcelibcex-devel] clock() function
Brought to you by:
mloskot
From: Mateusz L. <ma...@lo...> - 2006-09-24 13:37:05
|
One of users on the PocketPCDN.com forum, with nickname 'hav', posted a very nice implementation of clock() function: http://www.pocketpcdn.com/forum/viewtopic.php?p=19152 hav agrees to included it to WCELIBCEX library. Here is the function #include <time.h> #ifdef _WIN32_WCE #include <winbase.h> clock_t clock(void) { SYSTEMTIME stCurrent; FILETIME ftCurrent; GetSystemTime(&stCurrent); if(!SystemTimeToFileTime(&stCurrent, &ftCurrent)) { //throw _T("Can't convert time in sc_support::clock!"); } __int64 ticks = *(__int64*)&ftCurrent; return (clock_t)ticks; } #endif I'll include it ASAP. Cheers -- Mateusz Loskot http://mateusz.loskot.net |