Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save TyrfingMjolnir/0e75276316c16d25f75ce8856fd69d8e to your computer and use it in GitHub Desktop.

Select an option

Save TyrfingMjolnir/0e75276316c16d25f75ce8856fd69d8e 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