// // server entry // int main(int argc, char* argv[]) { extern int _r3d_bLogToConsole; extern int _r3d_bLogToDebug; _r3d_bLogToConsole = 1; _r3d_bLogToDebug = 0; extern int _r3d_bSilent_r3dError; _r3d_bSilent_r3dError = 1; r3d_CurrentProcess = GetCurrentProcess(); win::hInstance = GetModuleHandle(NULL); SetConsoleCtrlHandler(ConsoleHandlerRoutine, TRUE); try { if(argc > 1 && stricmp(argv[1], "-timer") == 0) { TestTimer(); } moveWindowToCorner(); // from SF config.cpp, bah. //extern void RegisterAllVars(); //RegisterAllVars(); gSupervisorConfig = new CSupervisorConfig(); r3dOutToLog("API: %s\n", gSupervisorConfig->webAPIDomainIP_.c_str()); // sleep 2 sec, waiting for master to start if(stricmp(gSupervisorConfig->webAPIDomainIP_.c_str(), "127.0.0.1") == 0) ::Sleep(2000); supervisorServerLoop(); } catch(const char* what) { r3dOutToLog("!!! Exception: %s\n", what); gSupervisorServer.Stop(); gSupervisorServer.TerminateAllGames(); HRESULT res = TerminateProcess(r3d_CurrentProcess, 0); } gSupervisorServer.Stop(); gSupervisorServer.TerminateAllGames(); gLogUploader.Stop(true); DestroyWindow(win::hWnd); ExitProcess(0); return 0; }
EFI_STATUS UefiMain( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; Status = testTimeOut(); Status = TestTimer(); Status = TestNotify(); Status = TestEventSingal(); Status = testMouseSimple(); return Status; }
int main( int argc, char *argv[] ) { char revcopy[64]; strcpy( revcopy, &rev[6] ); strtok( revcopy, "$" ); printf( "%s v0.15 rev %s\n", argv[0], revcopy ); struct timespec ts; int res = clock_getres( CLOCK_MONOTONIC, &ts ); printf( "clock_getres( CLOCK_MONOTONIC ) returns %d, resolution = %lu.%09lu\n", res, ts.tv_sec, ts.tv_nsec ); res = clock_gettime( CLOCK_MONOTONIC, &ts ); printf( "clock_gettime( CLOCK_MONOTONIC ) returns %d, time = %lu.%09lu\n", res, ts.tv_sec, ts.tv_nsec ); res = clock_getres( CLOCK_REALTIME, &ts ); printf( "clock_getres( CLOCK_REALTIME ) returns %d, resolution = %lu.%09lu\n", res, ts.tv_sec, ts.tv_nsec ); res = clock_gettime( CLOCK_REALTIME, &ts ); printf( "clock_gettime( CLOCK_REALTIME ) returns %d, time = %lu.%09lu\n", res, ts.tv_sec, ts.tv_nsec ); TestTimer( "/dev/timerx", 60 ); TestTimer( "/dev/timerm", 60 ); TestTimer( "clockm", 60 ); TestTimer( "clockr", 60 ); return 0; }