1

I read an article on BackgroundTasks: TimeTrigger and MaintenaceTrigger.

Here they demonstrate how these triggers can be used to download email. I'm trying to understand the practicality and appropriateness of this approach.

Quotas for BackgroundTasks on LockScreen are 2 seconds CPU time and non-LockScreen is 1 second CPU time.

Given this restriction, how is it possible that one can download emails in this amount of time? Surely, just establishing a connection to the remote server will take more time than that?

Am i misunderstanding something about how BackgroundTasks work or is this article inaccurate?

http://blogs.msdn.com/b/windowsappdev/archive/2012/05/24/being-productive-in-the-background-background-tasks.aspx

1 Answer 1

2

CPU Time is not the same as the amount of seconds that have passed. Your link references a Word Document, Introduction to Background Tasks, which contains the following:

CPU usage time refers to the amount of CPU time used by the app and not the wall clock time of the background task. For example, if the background task is waiting in its code for the remote server to respond, and it is not actually using the CPU, then the wait time is not counted against the CPU quota because the background task is not using the CPU.

If you are establishing a connection to the mail server (and waiting for it to respond), then you are not using any CPU. This means the time that you spent waiting is not counted against you.

Of course, you will want to test your background task to make sure that it stays within the limits.

1
  • Thank you so much! I've been struggling to understand this. That makes it very clear. Don't know how i missed the detail you pointed out.
    – c0D3l0g1c
    May 30, 2013 at 14:59

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.