dispatch_benchmark()
是 GCD
中未导出的函数。但是,您可以通过在代码中声明它来在 Objective C
中调用它:
uint64_t dispatch_benchmark(size_t count, void (^block)(void));
Swift
我该怎么做?
最佳答案
只需将声明放入桥接 header 中即可:
@import Foundation;
uint64_t dispatch_benchmark(size_t count, void (^block)(void));
这将使该函数在 Swift 中自动可用。
关于c - 如何从 Swift 调用 dispatch_benchmark,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36946864/