« first day (1843 days earlier)      last day (1001 days later) » 

12:47 AM
Which one is better, std::this_thread::yield() or std::this_thread::sleep_for(std::chrono:: milliseconds(1)) ?
 
 
12 hours later…
12:45 PM
yield indicates intent better unless you really want to resume in 1ms
 
12:56 PM
how often does yield actually do much nowadays?
I would've though in like the singly CPU-core times it was actually effective. Nowadays I don't know how much it changes unless you're busy waiting in like multiple threads
 
1:13 PM
depends on OS, honestly both options are bad
if you need to suspend you should use something that has good management characteristics
sleep_for is really intended for things like main event loops
 

« first day (1843 days earlier)      last day (1001 days later) »