Created
November 22, 2019 11:51
-
-
Save akkyie/e23649bc7c0b9c51f3c1ef123d2c974c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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