mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-13 13:37:02 +00:00
Major project restructuring
Remove unecessary files and made the tree much more cleaner. Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
13b2e741b9
commit
05c4f7025f
62 changed files with 2698 additions and 2453 deletions
45
core/common/Thread.h
Normal file
45
core/common/Thread.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2025 Xenon Emulator Project. All rights reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include "Types.h"
|
||||
|
||||
namespace Base
|
||||
{
|
||||
|
||||
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 std::string_view& name);
|
||||
|
||||
void SetThreadName(void* thread, const std::string_view& 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();
|
||||
|
||||
std::chrono::nanoseconds GetTotalWait() const { return total_wait; }
|
||||
};
|
||||
|
||||
} // namespace Base
|
||||
Loading…
Add table
Add a link
Reference in a new issue