Skip to content

lemutec/PresentMonFps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet Actions Platform

PresentMonFps

The PresentMon .NET Wrapper for calculating FPS.

Installation

Nugethttps://www.nuget.org/packages/PresentMonFps

Demo

// 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 and PresentMon.SampleConsole.

Thanks to

Licenses

MIT