Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Sleep function

Forum

Search UsersRules
Sleep function
#1
Active user
Points:: 0
Joined:: Sep 27, 2023

Hi experts,
   how to wait code for 1 second.

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello Selim!

The 1C company promised to add the "CallSleep" method in the 8.3.25 language version, which should implement a pause. But unfortunately, this has not been done yet :-(

Therefore, developers have to figure out how to implement a pause when executing code themselves.

In fact, there are many different options for making a pause, for example, a loop (never do this, since executing a loop puts a lot of load on the processor!) or running a script using VBScript and the WScript.Shell COM object method (this method will only work on Windows).

So as you can see, each of these methods has certain disadvantages...

For my part, I suggest using the HTTPConnection object and its Get method:


Code
Procedure Sleep(PeriodInSeconds)
   
   Try
      connection = New HTTPConnection("127.0.0.0",,,,,PeriodInSeconds);
      connection.Get(New HTTPRequest());
   Except
      
   EndTry;
   
EndProcedure

Profile
#3
Active user
Points:: 0
Joined:: Sep 27, 2023

Thank you for your help brother :)

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.