Skip to content

Instantly share code, notes, and snippets.

@zyuanming
Created July 7, 2017 09:52
Show Gist options
  • Select an option

  • Save zyuanming/2ab5aa7ac09122fe009ab40e7bd97318 to your computer and use it in GitHub Desktop.

Select an option

Save zyuanming/2ab5aa7ac09122fe009ab40e7bd97318 to your computer and use it in GitHub Desktop.
kdebug_signpost_start
kdebug_signpost_start(10, 0, 0, 0, 0)
// your test code
kdebug_signpost_end(10, 0, 0, 0, 0)
let urlSession = URLSession.shared
let dlTask: URLSessionDownloadTask = urlSession.downloadTask(with: url)
kdebug_signpost_start(20, (uintptr_t)dlTask, 0, 0, 0)
// your test code
kdebug_signpost_end(20, (uintptr_t)dlTask, 0, 0, 0)
// Color by last argument
// 0 - Blue, 1 - Green, 2 - Purple, 3 - Orange, 4 - Red
// DispatchQueue.concurrentPerform equal to objc dispatch_apply method
DispatchQueue.concurrentPerform(iterations: 10) { (index) in
kdebug_signpost_start(30, index, 0, 0, 0)
print("excute \(index)")
kdebug_signpost_end(30, index, 0, 0, index % 2 == 0 ? 4 : 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment