Skip to content

Simple FPS Stats service with an ability to check a UI thread responsiveness

License

Notifications You must be signed in to change notification settings

xamcat/perflab-fps-stats

Repository files navigation

PerfLab FPS Stats

A simple UI thread performance stats service for your dotnet app which approximately measures UI thread latency and FPS (frames per second) the UI thread is handling in real-time.

Demo

Usage

Dotnet MAUI example

  • Create and start the FPS Service
    using PerfLab.FpsStats; 
    ...
    _fpsService = new FpsStatsService();
    _fpsService.Start(action => Dispatcher.DispatchAsync(action));
    
  • Read FPS stats periodically
    CounterLabel.Text = _fpsService.Stats;
    
  • Subscribe for updates (optional)
    _fpsService.StatsUpdated += _fpsService_StatsUpdated;
    
    private void _fpsService_StatsUpdated(object sender, EventArgs e)
    {
        CounterLabel.Text = _fpsService.Stats;
    }
    
  • Stop service when not needed and unsubscribe from updates
    _fpsService.StatsUpdated -= _fpsService_StatsUpdated;
    _fpsService.Stop();
    

About

Simple FPS Stats service with an ability to check a UI thread responsiveness

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages