mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-22 06:21:41 +00:00
843d5d388e
* video info: add frame graph Toggle advanced info with CTRL+F10. Also fixed imgui using gamepad for nav in wrong situations * 60fps! Implemented a timer that accumulates the time spent sleeping and sleeps for the remaining time. Also measure entire PresentThread time instead of just the time spent in Flip. * sceKernelGettimeofday: replace chrono by win32 api. Better performance bb uses this function too much. Consuming almost 30% of cpu time
41 lines
847 B
C++
41 lines
847 B
C++
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
|
|
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <chrono>
|
|
#include "common/types.h"
|
|
|
|
namespace Common {
|
|
|
|
enum class ThreadPriority : u32 {
|
|
Low = 0,
|
|
Normal = 1,
|
|
High = 2,
|
|
VeryHigh = 3,
|
|
Critical = 4,
|
|
};
|
|
|
|
void SetCurrentThreadRealtime(std::chrono::nanoseconds period_ns);
|
|
|
|
void SetCurrentThreadPriority(ThreadPriority new_priority);
|
|
|
|
void SetCurrentThreadName(const char* name);
|
|
|
|
class AccurateTimer {
|
|
std::chrono::nanoseconds target_interval{};
|
|
std::chrono::nanoseconds total_wait{};
|
|
|
|
std::chrono::high_resolution_clock::time_point start_time;
|
|
|
|
public:
|
|
explicit AccurateTimer(std::chrono::nanoseconds target_interval);
|
|
|
|
void Start();
|
|
|
|
void End();
|
|
};
|
|
|
|
} // namespace Common
|