For performance debugging purposes, I need to watch the progress of my UI updates whenever a background task, operated by a GCD concurrency queue, finishes one of its tasks.
Without an artificial delay it is very hard to follow and react to what's happening.
Every single task takes maybe 10ms. I like it to take one second instead.
I tried slowing down the queue's task by adding a sleep(1);
to it, but that will allow other waiting tasks to run.
What I need is that each task really keeps occupying its queue until that extra second is over.
How do I do that without having to reorganize my entire queuing code? After all, this is only for debugging, and I'd like to just insert that code with conditional compilation instead of ending up with different code for debug and non-debug builds.