402
Views
4
Comments
Solved
Sleep
Question
Hi!

Is there a way to do a sleep? The aim is to stall the preparation of a screen for some seconds.
Cheers,
Mário
2011-08-23 22-04-05
Tiago Simões
Staff
Solution
Hi Mario,

Here's an extension with a very simple sleep function:
public void MssSleep(  int ssmillisecondsTimeout) {

System.Threading.Thread.Sleep(ssmillisecondsTimeout);
}
Cheers,
Tiago
OperatingSystem.xif
2018-05-07 20-49-39
Mário Araújo
Thanks Tiago!
2017-09-22 09-07-17
Toni Juvani
How can I prevent the sleep from always appearing in the general log as SLOWEXTENSION?

2016-04-01 11:08:27 15 Utils.Sleep took 1016 ms SLOWEXTENSION

We are waiting and polling for execution in an external application so the logs are filling with these messages.

Br,
Toni
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Hi Toni,

First, you replied to a 9 year old message. That's not generally considered good form!

That said, there's a setting on the "Operations" tab in Service Center that you can uncheck to hide messages from the extension, but I'm not sure whether it also hides the SLOWEXTENSION warnings. It may be that unchecking the checbox at the consuming eSpace will work.

If that checkbox doesn't work, a solution could be to sleep a short while multiple times. So call the Sleep 10 times with 100ms. That'll keep it under the radar of the Platform, but will amount to the same.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.