Using the Scheduler to Prioritize Jobs

You can take advantage of the WinJS Scheduler (introduced in Windows 8.1) to execute a JavaScript function with a specific priority.

Why would you want to do this? A Windows Store app written with JavaScript contains only one user interface thread. That thread must be used to do everything. The thread is used by both your application code and the controls in the WinJS library.

If you want to create an app that responds quickly to user interaction then you need to prioritize the work performed with this one and only user interface thread.

Note

A Windows Store app written with JavaScript contains a single user interface thread unless you use Web Workers. You can use Web Workers to create additional execution ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.