https://github.com/lemutec/presentmonfps
The PresentMon .NET Wrapper for calculating FPS.
https://github.com/lemutec/presentmonfps
fps game presentmon
Last synced: about 2 months ago
JSON representation
The PresentMon .NET Wrapper for calculating FPS.
- Host: GitHub
- URL: https://github.com/lemutec/presentmonfps
- Owner: lemutec
- License: mit
- Created: 2024-07-08T13:32:25.000Z (11 months ago)
- Default Branch: v2
- Last Pushed: 2024-08-14T11:32:30.000Z (10 months ago)
- Last Synced: 2025-03-27T16:41:04.541Z (2 months ago)
- Topics: fps, game, presentmon
- Language: C#
- Homepage:
- Size: 584 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://nuget.org/packages/PresentMonFps) [](https://github.com/lemutec/PresentMonFps/actions/workflows/library.nuget.yml) [](https://dotnet.microsoft.com/en-us/download/dotnet/latest/runtime)
# PresentMonFps
The PresentMon .NET Wrapper for calculating FPS.
## Installation
**Nuget**:https://www.nuget.org/packages/PresentMonFps
## Demo
```c#
// Check Available.
if (!FpsInspector.IsAvailable)
{
Console.WriteLine("This library is only available on Windows.");
return;
}// Simple method to get PID.
// Fullname is unnecessary.
uint pid = await FpsInspector.GetProcessIdByNameAsync("YourApp.exe");// Calculate FPS Once.
FpsResult result = await FpsInspector.StartOnceAsync(new FpsRequest(pid));
Console.WriteLine(result);// Calculate FPS Forever.
await FpsInspector.StartForeverAsync(new FpsRequest(pid), Console.WriteLine, null!);
```See more from [PresentMon.SampleWPF](https://github.com/lemutec/PresentMonFps/tree/v2/demo/PresentMon.SampleWPF) and [PresentMon.SampleConsole](https://github.com/lemutec/PresentMonFps/tree/v2/demo/PresentMon.SampleConsole).
## Thanks to
- https://github.com/GameTechDev/PresentMon
## Licenses
[MIT](https://github.com/lemutec/PresentMonFps/blob/v2/LICENSE)