void Profiler::StartProfiler() { Profiler* profiler = GetProfiler(); if(!profiler) return; profiler->timer.start(); }
// This is an example of an exported function. extern "C" VSPYPROF_API VsPyProfThread* InitProfiler(VsPyProf* profiler) { if (!profiler) { return nullptr; } auto thread = profiler->CreateThread(); if (thread != nullptr) { thread->GetProfiler()->PyEval_SetProfile(&TraceFunction, thread); } return thread; }
void GenerateTimerResults (void) { GetProfiler().GenerateLog(); }
void StopTimer (void) { GetProfiler().StopTimer(); }
DWORD StartTimer (DWORD Address) { return GetProfiler().StartTimer(Address); }
void ResetTimerList (void) { GetProfiler().ResetCounters(); }
bool RuntimeScene::RenderAndStep() { requestedChange.change = SceneChange::CONTINUE; ManageRenderTargetEvents(); timeManager.Update(clock.restart().asMicroseconds(), game->GetMinimumFPS()); ManageObjectsBeforeEvents(); if (game) game->GetSoundManager().ManageGarbage(); #if defined(GD_IDE_ONLY) if( GetProfiler() ) { if ( timeManager.IsFirstLoop() ) GetProfiler()->Reset(); GetProfiler()->eventsClock.reset(); } #endif GetCodeExecutionEngine()->Execute(); #if defined(GD_IDE_ONLY) if( GetProfiler() && GetProfiler()->profilingActivated ) { GetProfiler()->lastEventsTime = GetProfiler()->eventsClock.getTimeMicroseconds(); GetProfiler()->renderingClock.reset(); } #endif ManageObjectsAfterEvents(); #if defined(GD_IDE_ONLY) if( debugger ) debugger->Update(); #endif //Rendering Render(); #if defined(GD_IDE_ONLY) if( GetProfiler() && GetProfiler()->profilingActivated ) { GetProfiler()->lastRenderingTime = GetProfiler()->renderingClock.getTimeMicroseconds(); GetProfiler()->totalSceneTime += GetProfiler()->lastRenderingTime + GetProfiler()->lastEventsTime; GetProfiler()->totalEventsTime += GetProfiler()->lastEventsTime; GetProfiler()->Update(); } #endif return requestedChange.change != SceneChange::CONTINUE; }
void Profiler::ResetProfiler() { GetProfiler(); s_Profiler->m_operations.clear(); s_Profiler->timer.stop(); }
bool RuntimeScene::RenderAndStep() { requestedChange.change = SceneChange::CONTINUE; ManageRenderTargetEvents(); UpdateTime(); ManageObjectsBeforeEvents(); SoundManager::Get()->ManageGarbage(); #if defined(GD_IDE_ONLY) if( GetProfiler() ) { if ( firstLoop ) GetProfiler()->Reset(); GetProfiler()->eventsClock.reset(); } #endif if (GetCodeExecutionEngine()->Ready()) { #if !defined(RELEASE) BT_PROFILE("Events"); #endif GetCodeExecutionEngine()->Execute(); } #if defined(GD_IDE_ONLY) if( GetProfiler() && GetProfiler()->profilingActivated ) { GetProfiler()->lastEventsTime = GetProfiler()->eventsClock.getTimeMicroseconds(); GetProfiler()->renderingClock.reset(); } #endif ManageObjectsAfterEvents(); #if defined(GD_IDE_ONLY) if( debugger ) debugger->Update(); #endif //Rendering Render(); legacyTexts.clear(); #if defined(GD_IDE_ONLY) if( GetProfiler() && GetProfiler()->profilingActivated ) { GetProfiler()->lastRenderingTime = GetProfiler()->renderingClock.getTimeMicroseconds(); GetProfiler()->totalSceneTime += GetProfiler()->lastRenderingTime + GetProfiler()->lastEventsTime; GetProfiler()->totalEventsTime += GetProfiler()->lastEventsTime; GetProfiler()->Update(); } #endif firstLoop = false; //The first frame was rendered return requestedChange.change != SceneChange::CONTINUE; }