Ignore TSystem::Sleep() calls?

Hi All,

As part of my analysis code I use calls to TSystem::Sleep() to slow things down so I can monitor the output of fits and see updated histograms and graphs. I use this exclusively for diagnostics. When I am happy with how things work I comment out all my TSystem::Sleep() calls, recompile, and run the code in batch mode.

What I’d like is some method of telling root that it should ignore calls to TSystem::Sleep() so that I don’t have to go searching for all the instances of them to comment them out. Does such a thing exist?

For example, what I’d like to be able to do is something like:

void myMacro(Bool_t ignoreSleep){

//Does something that can accomplish this exist?
gSystem->SetIgnoreSleep(ignoreSleep);

//Do Analysis Here

//Sleep depending on the status of ignoreSleep
gSystem->Sleep(1000);

}

Cheers,
Chris

How about “if” statements? Or multiply the sleep duration by the value of the boolean sleep parameter (so all sleep durations will be 0 for sleep = kFALSE).

Also you could just use sed or an IDE to comment out all the sleep calls automatically.

Jean-François

[quote=“jfcaron”]How about “if” statements? Or multiply the sleep duration by the value of the boolean sleep parameter (so all sleep durations will be 0 for sleep = kFALSE).

Also you could just use sed or an IDE to comment out all the sleep calls automatically.

Jean-François[/quote]

I’ve used if statements to accomplish this, but I tend to think they bloat the source code and thus I find them visually unappealing. Your second idea though, about multiplying by the boolean sleep value, is beautifully elegant! =D>

Thank You!
-Chris