How to convert NSTimeInterval in a few seconds (for backgroundTimeRemaining)

I am checking to measure how much time is left for the remaining background job. I read a few examples and saw that everyone does it this way:

UIApplication *app = [UIApplication sharedApplication]; double *bgTime = app.backgroundTimeRemaining; NSLog(@"Background Time Remaining: %f", bgTime); 

But I get a very big value, for example, 1797693134862315708145274237317043567980705675258449965989 ...

I understand that [[UIApplication sharedApplication] backgroundTimeRemaining] is NSTimeInterval, but is there a way to convert this to only x seconds?

I also tried this one , but that will not work.

Any help would be appreciated. Thanks.

+4
source share
2 answers

If the application is in the foreground, the time will be great according to the documentation here .

+2
source

Because NSTimeInterval is a float or double , but not a pointer. double *bgTime should be double bgTime .

+2
source

All Articles