John Waters
John Waters

Reputation: 739

Windows 8 WinRT background task time resolution

Can a WinRT background task triggered by a 15 min periodic timer start it's own thread, which then sleeps and wakes up every say 30 seconds? I.e. if you need a background task to do stuff more often than the minimum resolution, would this hack work? If battery life is not a concern...and would it would even when not on AC?

Upvotes: 2

Views: 1195

Answers (1)

driis
driis

Reputation: 164291

The background task can spawn a thread; BUT it may only use up to two CPU seconds per 15 minutes. In other words, you don't get permission to just run whatever thread work you'd like, you need to keep within constraints. The details are explained in the Introduction to Background Tasks document MS published:

An app on the lock screen receives a certain amount of CPU time at regular intervals for its background tasks. If the app uses all of its available CPU time, its background tasks are suspended until the app’s CPU quota is replenished at the next generation for CPU quota updates.

Upvotes: 5

Related Questions