Thread::wait() question

Is it possible to use Thread::wait() to add a delay in when some code is executed inside the run() method?


void MyThread::run() override {
     auto tStart = juce::Time::currentTimeMillis();
     DBG( "somemessage" );
     wait(500);  //wait 0.5 seconds
     //hopefully this line is executed 0.5 seconds later
     DBG( "delay " + String( juce::Time::currentTimeMillis() - tStart ) ); 

Yes. But bear in mind it could return early if something interrupts it, like the thread trying to stop.