Wait function in root

How do you add a wait function in root? I tried sleep and delay functions from C++ but they don’t seem to be working.

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18
Platform: Windows
Compiler: Not Provided

This is probably a Windows-only problem. I just tried sleep(5) in ROOT’s prompt, and it took 5 seconds to get the prompt back.

There is also TSystem::Sleep() method. Just do:


i used it to display a histogram for 5 seconds, then display another histogram for 5 seconds then display the sum of the two histograms but I’m getting a blank canvas for 10 seconds instead. Is it related to the Sleep function which you suggested or the problem is elsewhere. What alternative methods to hold the program can be used?

Before the “wait”, try to add:

gPad->Modified(); gPad->Update; // make sure it is (re)drawn
gSystem->ProcessEvents(); gSystem->ProcessEvents();