Skip to content

Instantly share code, notes, and snippets.

@finestructure
Created February 10, 2020 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save finestructure/065a21928cfbe0d6186c04dfda6654ef to your computer and use it in GitHub Desktop.
Save finestructure/065a21928cfbe0d6186c04dfda6654ef to your computer and use it in GitHub Desktop.
Swift scripting example use of dispatchMain
#!/usr/bin/env swift
import Foundation
import Dispatch
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
print("Done.")
exit(EXIT_SUCCESS)
}
print("Starting...")
dispatchMain()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment