Closed thomthom closed 1 year ago
Are there examples of when sleep
can be used? I'm thinking of how to phrase the message in the cop.
Reasons not to use it is how it freezes up SketchUp and UI.start_timer
can maybe be used as an alternative.
I've seen it usually as a way to deal with async behaviour. The appropriate solution would be to wait for an event that signal the completion of whatever you're waiting for. (Like HTTP requests)
Othertimes it can be animations.
Often the usage of
sleep
is a code smell. Consider a cop to flag this usage to guide EW reviewers for closer inspection of it's usage.