3 ms·
My experience is that NSLog is suprisingly slow. I remember investigating why a program was running so slowly and removing NSLog from the main loop made it sign
by armchairhacker 5y ago
My experience is that NSLog is suprisingly slow. I remember investigating why a program was running so slowly and removing NSLog from the main loop made it significantly faster. Maybe the underlying console was slower than I expected, or the messages had to be sent through my iPhone's USB?
Because of this and the author's issue, I don't see why you should ever use NSLog in Swift. Even if you need a timestamp, you could just write a custom logging function using printf.
- saagarjha 5y agoNSLog goes to the system console; printf does not.