Stopwatch loosing time in a browser using blazor and web assembly when browser put in background

41 Views Asked by At

I have a fairly simple web assembly blazor app that I have created and released as open source to help coaches of high school track runners. You can run multiple timers and take splits for multiple kids at the same time demo found at track.tek-flow.com . If the browser is kept in the foreground and you don't let your screen go to sleep then the timer works as expected. However if you close your screen and come back the StopWatch is behind on time. It's fine that the page is paused but each StopWatch needs to keep an accurate time in the millisecond range. Is there any way to keep the browser from stopping the StopWatch or to have it resume in Blazor? I've not tried running it as a PWA but am not sure if that would run into the same issue.

0

There are 0 best solutions below