On Sep 6, 2016, at 12:35 PM, Kirk Brooks wrote:

> Ferdinando,
> Sometimes it's more precise to use milliseconds. For instance, if I want to
> delay a process for exactly 3/4 of a second I can use:
> 
> $ms:=Milliseconds+750  //  this is when the loop is done
> While (Milliseconds<$ms)
>  Idle
> End while
> 
> You could do the same thing with ticks and the Tickcount function:

Don’t forget your friend DELAY PROCESS to delay a process. It’s supposed to be 
more optimized than using IDLE in a loop. At least that’s what the engineers at 
4D say. And I’d venture a guess that it is very efficient when used in a new 
v16 preemptive worker process. 

And starting with v15 you can specify a C_REAL value for the tick count of 
DELAY PROCESS so you can get more control than just 0.0167 seconds of delay. 
You can now get sub-millisecond control over the delay interval. 

I have to admit I’d be hard pressed to site a useful real world case where you 
want/need to delay a process for even a single millisecond. But it is now 
supposedly possible with 4D v15+.

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
********************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to