DNS duration 4294893875545978

When I use NSURLSessionTaskTransactionMetrics property domainLookupStartDate and domainLookupEndDate to calculate the duration of DNS, sometimes I get 4294893875545978 or -4294893875545978 return

method like this

[NSNumber numberWithLongLong:[taskMetrics.domainLookupEndDate timeIntervalSinceDate:taskMetrics.domainLookupStartDate?]*1000000000]

The hexadecimal value of 4294893875545978 is 0xF3F3F3F3F3F3A. Is 4294893875545978 a special value?

supplement: This number will be stored in the sqlite database and then read out and uploaded. So, what could have gone wrong?

New findings, involves NSURLSessionTaskTransactionMetrics domainLookupStartDate

[NSNumber numberWithLongLong:[taskMetrics.domainLookupEndDate timeIntervalSinceDate:taskMetrics.responseStartDate]*1e9] also has this problem

The hexadecimal value of 4294893875545978 is 0xF3F3F3F3F3F3A.

Is it? That’s not what I calculate:

(lldb) p/x 4294893875545978
(long) 0x000f422ee7ccc77a
(lldb) p/x -4294893875545978
(long) 0xfff0bdd118333886

I’m not entirely sure what’s going on with your code but I do have one hint to pass along: Both domainLookupStartDate and domainLookupEndDate can be nil, so you should only run this calculation if both values are valid.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

DNS duration 4294893875545978
 
 
Q