Code from https://gist.github.com/steipete/3933090 "Simple main thread usage detector that I'm using in PSPDFKit // > to find performance problems early on."