Skip to content

Instantly share code, notes, and snippets.

@akkyie
Created November 22, 2019 11:51
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 akkyie/e23649bc7c0b9c51f3c1ef123d2c974c to your computer and use it in GitHub Desktop.
Save akkyie/e23649bc7c0b9c51f3c1ef123d2c974c to your computer and use it in GitHub Desktop.
func os_signpost(_ event: String) {
print(event)
}
@_functionBuilder public struct Measure {
public static var buildBlock: (_: Any...) -> Void {
os_signpost("start")
return { (_: Any...) -> Void in
os_signpost("end")
}
}
}
@Measure
func test() {
print(#line)
let a = 1234
print(#line)
1234
}
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment