Last edit
Summary: = Performance = import Foundation let startTime = CFAbsoluteTimeGetCurrent() Thread.sleep(until: Date().addingTimeInterval(1.0)) . . .
Changed:
< = Performance =
to
> == Performance ==
> Quick and dirty snippet to measure time. Here's an example to measure 1 second of sleeping.
Quick and dirty snippet to measure time. Here's an example to measure 1 second of sleeping.
import Foundation
let startTime = CFAbsoluteTimeGetCurrent() Thread.sleep(until: Date().addingTimeInterval(1.0)) let duration = CFAbsoluteTimeGetCurrent() - startTime NSLog("Parse time: %f seconds", duration)