How to convert UInt64 to Int64?

2.9k Views Asked by At

The second argument in this function call:

dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC)

causes the compiler error:

'UInt64' is not convertible to 'Int64'

Swift Reference:

func dispatch_time(when: dispatch_time_t, delta: Int64) -> dispatch_time_t

var NSEC_PER_SEC: UInt64 { get } /* nanoseconds per second */
1

There are 1 best solutions below

0
On

See: How do you cast a UInt64 to an Int64? That question doesn't show up when googling the compiler error: 'UInt64' is not convertible to 'Int64'