这篇教程C++ timeEndPeriod函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中timeEndPeriod函数的典型用法代码示例。如果您正苦于以下问题:C++ timeEndPeriod函数的具体用法?C++ timeEndPeriod怎么用?C++ timeEndPeriod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了timeEndPeriod函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Sys_Quitvoid Sys_Quit( void ){ timeEndPeriod( 1 ); SV_Shutdown( "Server quit/n" ); CL_Shutdown(); if( dedicated && dedicated->integer ) FreeConsole(); // shut down QHOST hooks if necessary DeinitConProc(); Qcommon_Shutdown(); exit( 0 );}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:17,
示例2: timeEndPeriodLC3Sound::~LC3Sound(){ /* stop the timer */ timeEndPeriod( 20); timeKillEvent( gwid); lpSwSamp->Stop(); lpSwSamp->Release(); lpSwSamp = NULL; lpDirectSoundBuffer->Stop(); lpDirectSoundBuffer->Release(); lpDirectSound->Release(); lpDirectSound = NULL; free(soundData);}
开发者ID:MaddTheSane,项目名称:lc3tonegenerator,代码行数:17,
示例3: Sys_Errorvoid Sys_Error (const char *error, ...){ va_list argptr; char text[1024]; va_start (argptr, error); vsnprintf (text, sizeof(text), error, argptr); va_end (argptr); timeEndPeriod( 1 ); CL_Shutdown (); Qcommon_Shutdown (); if (qDedConsole) { MSG msg; BOOL bRet; Conbuf_AppendText( text ); Conbuf_AppendText( "/n" ); Sys_SetErrorText( text ); Sys_ShowConsole( 1, true ); // wait for the user to quit while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) { if (bRet == -1) break; TranslateMessage (&msg); DispatchMessage (&msg); Sleep(25); } } else { MessageBox(NULL, text, "Error", 0 /* MB_OK */ ); } Sys_DestroyConsole(); exit (1);}
开发者ID:chrisnew,项目名称:quake2,代码行数:45,
示例4: Sys_Error/*=================Sys_Error=================*/void Sys_Error( const char *error, ... ) { va_list argptr; char string[4096];#if defined (_WIN32) && !defined (_DEBUG) MSG msg;#endif va_start (argptr,error); idStr::vsnPrintf (string, sizeof(string), error, argptr); va_end (argptr);#if defined (_WIN32) && !defined (_DEBUG) Conbuf_AppendText( string ); Conbuf_AppendText( "/n" );#else // Print text in the console window/box Sys_Print( string ); Sys_Print( "/n" );#endif#if defined (_WIN32) && !defined (_DEBUG) Sys_SetErrorText( string ); Sys_ShowConsole( 1, qtrue ); timeEndPeriod( 1 ); IN_Shutdown(); // wait for the user to quit while ( 1 ) { if ( !GetMessage( &msg, NULL, 0, 0 ) ) { Com_Quit_f(); } TranslateMessage( &msg ); DispatchMessage( &msg ); } Sys_DestroyConsole();#endif CL_Shutdown( ); Sys_ErrorDialog( string ); Sys_Exit( 1 );}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:50,
示例5: TriggerThreadCBaseReferenceClock::~CBaseReferenceClock(){ if (m_TimerResolution) timeEndPeriod(m_TimerResolution); m_pSchedule->DumpLinkedList(); if (m_hThread) { m_bAbort = TRUE; TriggerThread(); WaitForSingleObject( m_hThread, INFINITE ); EXECUTE_ASSERT( CloseHandle(m_hThread) ); m_hThread = 0; EXECUTE_ASSERT( CloseHandle(m_pSchedule->GetEvent()) ); delete m_pSchedule; }}
开发者ID:DishBird,项目名称:VideoSuiteUtilities,代码行数:18,
示例6: sanity_runint sanity_run(struct cpuid_state_t *state){ sanity_handler_t *p = handlers; unsigned int ret = 0;#ifdef TARGET_OS_WINDOWS TIMECAPS tc; timeGetDevCaps(&tc, sizeof(TIMECAPS)); timeBeginPeriod(tc.wPeriodMin);#endif while (*p) { if ((*p++)(state) != 0) ret = p - handlers; }#ifdef TARGET_OS_WINDOWS timeEndPeriod(tc.wPeriodMin);#endif return ret;}
开发者ID:msuchard,项目名称:cpuid,代码行数:18,
示例7: DllMainBOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved){ switch( ul_reason_for_call ) { case DLL_PROCESS_ATTACH: {// BUG - EXE/DLL Paths - start dllModule = hModule;#ifdef _DEBUG MessageBox(0, "DLL attached", "Message", 0);#endif// BUG - EXE/DLL Paths - end // The DLL is being loaded into the virtual address space of the current process as a result of the process starting up OutputDebugString("DLL_PROCESS_ATTACH/n"); // set timer precision MMRESULT iTimeSet = timeBeginPeriod(1); // set timeGetTime and sleep resolution to 1 ms, otherwise it's 10-16ms FAssertMsg(iTimeSet==TIMERR_NOERROR, "failed setting timer resolution to 1 ms"); } break; case DLL_THREAD_ATTACH: // OutputDebugString("DLL_THREAD_ATTACH/n"); break; case DLL_THREAD_DETACH: // OutputDebugString("DLL_THREAD_DETACH/n"); break; case DLL_PROCESS_DETACH:// BUG - EXE/DLL Paths - start dllModule = NULL;// BUG - EXE/DLL Paths - end OutputDebugString("DLL_PROCESS_DETACH/n"); timeEndPeriod(1); GC.setDLLIFace(NULL); break; } return TRUE; // success}
开发者ID:enepomnyaschih,项目名称:MyMod,代码行数:44,
示例8: QueryPerformanceCounter//=============================================================================// Call repeatedly by the main message loop in WinMain//=============================================================================void Game::run(HWND hwnd){ if(graphics == NULL) // if graphics not initialized return; // calculate elapsed time of last frame, save in frameTime QueryPerformanceCounter(&timeEnd); frameTime = (float)(timeEnd.QuadPart - timeStart.QuadPart ) / (float)timerFreq.QuadPart; // Power saving code, requires winmm.lib // if not enough time has elapsed for desired frame rate if (frameTime < MIN_FRAME_TIME) { sleepTime = (DWORD)((MIN_FRAME_TIME - frameTime)*1000); timeBeginPeriod(1); // Request 1mS resolution for windows timer Sleep(sleepTime); // release cpu for sleepTime timeEndPeriod(1); // End 1mS timer resolution return; } if (frameTime > 0.0) fps = (fps*0.99f) + (0.01f/frameTime); // average fps if (frameTime > MAX_FRAME_TIME) // if frame rate is very slow frameTime = MAX_FRAME_TIME; // limit maximum frameTime timeStart = timeEnd; // update(), ai(), and collisions() are pure virtual functions. // These functions must be provided in the class that inherits from Game. if (!paused) // if not paused { update(); // update all game items ai(); // artificial intelligence collisions(); // handle collisions input->vibrateControllers(frameTime); // handle controller vibration } renderGame(); // draw all game items input->readControllers(); // read state of controllers // Clear input // Call this after all key checks are done input->clear(inputNS::KEYS_PRESSED);}
开发者ID:parkmk2,项目名称:test,代码行数:47,
示例9: SDL_SetSystemTimerResolutionstatic voidSDL_SetSystemTimerResolution(const UINT uPeriod){#ifndef __WINRT__ static UINT timer_period = 0; if (uPeriod != timer_period) { if (timer_period) { timeEndPeriod(timer_period); } timer_period = uPeriod; if (timer_period) { timeBeginPeriod(timer_period); } }#endif}
开发者ID:dmdware,项目名称:vec,代码行数:19,
示例10: exit_main GuiApp::~GuiApp() { //! close simulation exit_main(0); libManager->releaseLibrary("cfg_manager"); libManager->releaseLibrary("lib_manager_gui"); libManager->releaseLibrary("main_gui"); libManager->clearLibraries(); delete libManager;#ifdef WIN32 // end scheduler of 1ms timeEndPeriod(1);#endif //WIN32 }
开发者ID:annaborn,项目名称:mars,代码行数:19,
示例11: hal_closeLOCAL TCALLBACK voidhal_close(struct THALBase *hal, struct TTask *task){ struct HALSpecific *hws = hal->hmb_Specific; EnterCriticalSection(&hws->hsp_DevLock); if (hws->hsp_Timer) { if (--hws->hsp_RefCount == 0) { timeKillEvent(hws->hsp_Timer); timeEndPeriod(1); hws->hsp_Timer = TNULL; } } LeaveCriticalSection(&hws->hsp_DevLock);}
开发者ID:callcc,项目名称:tekui,代码行数:19,
示例12: QueryPerformanceCountervoid Game::run(HWND hWnd){ if (graphics_ == NULL) // If graphics not initialized { return; } QueryPerformanceCounter(&timeEnd_); frameTime_ = (double)(timeEnd_.QuadPart - timeStart_.QuadPart) / (double)timerFreq_.QuadPart; // if the frame time is less than MIN_FRAME_TIME do idle processing //otherwise run game if (frameTime_ < MIN_FRAME_TIME) { //figure out how long to sleep for sleepTime_ = (DWORD)(MIN_FRAME_TIME - frameTime_) * 1000; timeBeginPeriod(1);// Request 1mS resolution for windows timer Sleep(sleepTime_); // Release CPU for sleepTime timeEndPeriod(1); // End 1mS timer resolution return; } if (frameTime_ > 0.0) { fps_ = (fps_ * .99) + (0.1 / frameTime_); } if (frameTime_ > MAX_FRAME_TIME) { frameTime_ = MAX_FRAME_TIME; } // reset the elapsed time to 0 timeStart_ = timeEnd_; //Pure virtual functions defined by derived Classes update(); // Update all game items renderGame(); //renderGame() draws all items and calls pure virtual function render // Clear input // Call this after all key checks are done input_->clear(InputConstants::KEYS_PRESSED);}
开发者ID:Math273Project,项目名称:SuperMarioBros,代码行数:43,
示例13: gdk_frame_clock_idle_end_updatingstatic voidgdk_frame_clock_idle_end_updating (GdkFrameClock *clock){ GdkFrameClockIdle *clock_idle = GDK_FRAME_CLOCK_IDLE (clock); GdkFrameClockIdlePrivate *priv = clock_idle->priv; g_return_if_fail (priv->updating_count > 0); priv->updating_count--; maybe_stop_idle (clock_idle);#ifdef G_OS_WIN32 if (priv->updating_count == 0 && priv->begin_period) { timeEndPeriod(1); priv->begin_period = FALSE; }#endif}
开发者ID:3dfxmadscientist,项目名称:gtk,代码行数:19,
示例14: InfoNES_StopTimer/*===================================================================*/static void InfoNES_StopTimer(){ LOGV("InfoNES_StopTimer"); if ( 0 != uTimerID ) {#ifdef WIN32 TIMECAPS caps; timeKillEvent( uTimerID ); uTimerID = 0; timeGetDevCaps( &caps, sizeof(caps) ); timeEndPeriod( caps.wPeriodMin * TIMER_PER_LINE );#else timer_delete( uTimerID ); uTimerID = 0;#endif } // Delete Critical Section Object LOGV("InfoNES_StopTimer finished");}
开发者ID:Tonyfield,项目名称:Nester,代码行数:20,
示例15: Sys_Quit/*================Sys_QuitThis function never returns.================*/void Sys_Quit(void){ timeEndPeriod(1);#if USE_CLIENT#if USE_SYSCON if (dedicated && dedicated->integer) { FreeConsole(); }#endif#elif USE_WINSVC if (statusHandle && !shouldExit) { shouldExit = SE_YES; Com_AbortFrame(); }#endif exit(0);}
开发者ID:richard-allen,项目名称:q2pro,代码行数:26,
示例16: DirectSoundClosevoid DirectSoundClose( MADDriverRec* WinMADDriver){ if( WinMADDriver->lpDirectSound) { /* stop the timer */ timeKillEvent( gwID); timeEndPeriod( 20); WinMADDriver->lpSwSamp->lpVtbl->Stop( WinMADDriver->lpSwSamp); WinMADDriver->lpSwSamp->lpVtbl->Release( WinMADDriver->lpSwSamp); WinMADDriver->lpSwSamp = 0L; WinMADDriver->lpDirectSoundBuffer->lpVtbl->Stop(WinMADDriver->lpDirectSoundBuffer); WinMADDriver->lpDirectSoundBuffer->lpVtbl->Release(WinMADDriver->lpDirectSoundBuffer); WinMADDriver->lpDirectSound->lpVtbl->Release( WinMADDriver->lpDirectSound); WinMADDriver->lpDirectSound = NULL; }}
开发者ID:mctully,项目名称:tntbasic,代码行数:19,
示例17: timeBeginPeriodvoid APIDataReceiver::run(){ timeBeginPeriod(1); int lastUpdate = -1; while(!stop) { // wait for new data and copy it into the data buffer, if data is not null if(waitForDataReady(TIMEOUT, data)) { if(header) { // if header changes size, assume a new connection if(!data || dataSize != header->bufLen) { reset(); dataSize = header->bufLen; data = new char[dataSize]; } else if(data) { if(lastUpdate < header->sessionInfoUpdate) { updateStaticInfo(); //TODO: update semi-static data lastUpdate = header->sessionInfoUpdate; } //TODO: update dynamic data } } } else if(!isConnected()) { // session ended reset(); } } reset(); shutdown(); timeEndPeriod(1);}
开发者ID:squeakyball,项目名称:spectacular,代码行数:42,
示例18: Sys_Error/*=================Sys_Error=================*/void Sys_Error(const char *error, ...){ va_list argptr; char string[1024];#if defined (USE_WINDOWS_CONSOLE) MSG msg;#endif va_start(argptr, error); Q_vsnprintf(string, sizeof(string), error, argptr); va_end(argptr);#if defined (USE_WINDOWS_CONSOLE) Conbuf_AppendText(string); Conbuf_AppendText("/n"); Sys_Splash(qfalse); Sys_SetErrorText(string); Sys_ShowConsole(1, qtrue); timeEndPeriod(1); IN_Shutdown(); // wait for the user to quit while (1) { if (!GetMessage(&msg, NULL, 0, 0)) { Com_Quit_f(); } TranslateMessage(&msg); DispatchMessage(&msg); } Sys_DestroyConsole();#endif Sys_ErrorDialog(string); Sys_Exit(3);}
开发者ID:scenna,项目名称:etlegacy,代码行数:47,
示例19: System_Logvoid CALL HGE_Impl::System_Shutdown(){ System_Log("/nFinishing.."); timeEndPeriod(1); _ClearQueue(); _SoundDone(); _GfxDone(); if(hwnd) { //ShowWindow(hwnd, SW_HIDE); //SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_TOOLWINDOW); //ShowWindow(hwnd, SW_SHOW); DestroyWindow(hwnd); hwnd=0; } if(hInstance) UnregisterClass(WINDOW_CLASS_NAME, hInstance); System_Log("The End.");}
开发者ID:DreamNex,项目名称:MultiplayerA2,代码行数:20,
示例20: timeBeginPeriodRpcs3App::Rpcs3App(){#ifdef _WIN32 timeBeginPeriod(1); WSADATA wsaData; WORD wVersionRequested = MAKEWORD(2, 2); WSAStartup(wVersionRequested, &wsaData); std::atexit([] { timeEndPeriod(1); WSACleanup(); });#endif#if defined(__unix__) && !defined(__APPLE__) XInitThreads();#endif}
开发者ID:sergioengineer,项目名称:rpcs3,代码行数:20,
示例21: DllMain// Standard DLL loader mainBOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved){ switch (dwReason) { case DLL_PROCESS_ATTACH: gHInstance = (HINSTANCE)hinstDLL; SetupThunRTMainHook(); timeBeginPeriod(1); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: timeEndPeriod(1); CleanUp(); break; } return TRUE;}
开发者ID:zeriyoshi,项目名称:LunaDLL,代码行数:21,
示例22: deinit_throttle_timer/*=============================================================================This routine de-intializes the system timer used for throttling the emulationspeed.=============================================================================*/void deinit_throttle_timer(void){#ifdef WIN32 /* Kill the timer event */ if (gThrottleId != 0) timeKillEvent(gThrottleId); /* End the timer period */ timeEndPeriod(gThrottlePeriod); /* Destory the triggering event */ CloseHandle(gThrottleEvent);#else /* Instruct the throttle thread to terminate */ gThrottleExit = 1; /* Join our throttle thread to ensure a clean shutdown */ pthread_join(gThrottleThread, NULL);#endif}
开发者ID:ProfSteve,项目名称:virtualt,代码行数:26,
示例23: system_End/** * Cleans up after system_Init() and system_Configure(). */void system_End(void){ HWND ipcwindow; /* FIXME: thread-safety... */ if (p_helper) { if( ( ipcwindow = FindWindow( 0, L"VLC ipc "VERSION ) ) != 0 ) { SendMessage( ipcwindow, WM_QUIT, 0, 0 ); } vlc_object_release (p_helper); p_helper = NULL; } timeEndPeriod(5); /* XXX: In theory, we should not call this if WSAStartup() failed. */ WSACleanup();}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:23,
示例24: IDsCaptureDriverNotifyImpl_Releasestatic ULONG WINAPI IDsCaptureDriverNotifyImpl_Release(PIDSDRIVERNOTIFY iface){ IDsCaptureDriverNotifyImpl *This = (IDsCaptureDriverNotifyImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p) ref was %d/n", This, refCount + 1); if (!refCount) { This->buffer->notify = NULL; if (This->timerID) { timeKillEvent(This->timerID); timeEndPeriod(DS_TIME_RES); } HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released/n", This); } return refCount;}
开发者ID:mikekap,项目名称:wine,代码行数:20,
示例25: timeEndPeriod/** Close sockets used* @param[in] port = port context struct* @return 0*/int ecx_portt::closenic(){ timeEndPeriod(15); if (this->sockhandle != NULL) { DeleteCriticalSection(&(this->getindex_mutex)); DeleteCriticalSection(&(this->tx_mutex)); DeleteCriticalSection(&(this->rx_mutex)); pcap_close(this->sockhandle); this->sockhandle = NULL; } if ((this->redport) && (this->redport->sockhandle != NULL)) { pcap_close(this->redport->sockhandle); this->redport->sockhandle = NULL; } return 0;}
开发者ID:TABETA,项目名称:SOEM,代码行数:24,
示例26: mm_start_timerstatic int mm_start_timer(struct qemu_alarm_timer *t){ timeGetDevCaps(&mm_tc, sizeof(mm_tc)); timeBeginPeriod(mm_tc.wPeriodMin); mm_timer = timeSetEvent(mm_tc.wPeriodMin, /* interval (ms) */ mm_tc.wPeriodMin, /* resolution */ mm_alarm_handler, /* function */ (DWORD_PTR)t, /* parameter */ TIME_ONESHOT | TIME_CALLBACK_FUNCTION); if (!mm_timer) { fprintf(stderr, "Failed to initialize win32 alarm timer/n"); timeEndPeriod(mm_tc.wPeriodMin); return -1; } return 0;}
开发者ID:AlexWWW,项目名称:qemu-linaro-clone,代码行数:20,
示例27: WinMainint WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ const int SAMPLES = 32; DWORD t1[SAMPLES], t2[SAMPLES]; __int64 t3[SAMPLES], t4[SAMPLES], freq3, freq4; TIMECAPS tc; timeGetDevCaps(&tc, sizeof(tc)); timeBeginPeriod(1); QueryPerformanceFrequency((LARGE_INTEGER *) & freq3); freq3 /= 1000; freq4 = MyQueryFrequency(); freq4 /= 1000; for (int i=0; i<SAMPLES; i++) { for (int j=0; j<200; j++) // roughly 0.2 ms to 0.5ms delay DeleteObject(CreateSolidBrush(0)); t1[i] = GetTickCount(); t2[i] = timeGetTime(); QueryPerformanceCounter((LARGE_INTEGER *) & t3[i]); t4[i] = MyQueryCounter(); } timeEndPeriod(1); TCHAR buffer[1024]; sprintf(buffer, _T("tick mm %d Khz %5.1f Mhz %5.1f Mhz/n/n"), tc.wPeriodMin, freq3/1000.0, freq4/1000.0); for (i=0; i<SAMPLES; i++) wsprintf(buffer+ _tcslen(buffer), "%8d %8d %8d %8d/n", (t1[i]-t1[0])*1000000, (t2[i]-t2[0])*1000000, (int)((t3[i]-t3[0])*1000000/freq3), (int)((t4[i]-t4[0])*1000000/freq4)); MyMessageBox(NULL, buffer, "Timer Accuracy", MB_OK); return 0;}
开发者ID:wcardozo,项目名称:fengyuan,代码行数:40,
示例28: ofExitCallbackvoid ofExitCallback(){ // controlled destruction of the mainLoop before // any other deinitialization mainLoop.reset(); // everything should be destroyed here, except for // static objects // finish every library and subsystem #ifndef TARGET_EMSCRIPTEN ofURLFileLoaderShutdown(); #endif #ifndef TARGET_NO_SOUND //------------------------ // try to close engine if needed: ofSoundShutdown(); //------------------------ #endif // try to close quicktime, for non-linux systems: #if defined(OF_VIDEO_CAPTURE_QUICKTIME) || defined(OF_VIDEO_PLAYER_QUICKTIME) closeQuicktime(); #endif //------------------------ // try to close freeImage: ofCloseFreeImage(); #ifdef WIN32_HIGH_RES_TIMING timeEndPeriod(1); #endif // static deinitialization happens after this finishes // every object should have ended by now and won't receive any // events}
开发者ID:K0j0,项目名称:openFrameworks,代码行数:40,
注:本文中的timeEndPeriod函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ timeGetDevCaps函数代码示例 C++ timeChanged函数代码示例 |