mirror of
https://github.com/ilyakooo0/metal-metaballs.git
synced 2024-09-11 10:35:56 +03:00
11 lines
235 B
Swift
11 lines
235 B
Swift
|
|
import Dispatch
|
|
|
|
func delay(_ duration: Float = 1, block: @escaping () -> ()) {
|
|
DispatchQueue.main.asyncAfter(
|
|
deadline: DispatchTime.now() +
|
|
Double(duration * Float(NSEC_PER_SEC)) /
|
|
Double(NSEC_PER_SEC),
|
|
execute: block)
|
|
}
|