Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Similar function for sleep
Sat, Nov 9 2013 1:39 PMPermanent Link

Mike

Is there a similar function which pauses program execution for a specified number of microseconds or can it be simulated?

Regards.

Mike
Thu, Nov 14 2013 3:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< Is there a similar function which pauses program execution for a
specified number of microseconds or can it be simulated? >>

There's nothing that absolutely, positively stops the execution on a
particular set of code unless you simply loop on a variable.  JS simply
always wants to be asynchronous, so the closest you can get is a TTimer, but
that won't prevent other code from executing in the meantime.

What are you trying to accomplish ?  I might be able to offer a better
work-around.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Nov 15 2013 2:43 AMPermanent Link

Mike

Hi Tim,

I would like to move a few images from right to left with some delay.

A timer could indeed work. However is it performance wise to use one or more timers in the application?

Regards.

Mike
Fri, Nov 15 2013 5:18 AMPermanent Link

Matthew Jones

I have applications with multiple timers and it works fine. I presume that they are
single threaded, but they do separate things usually (one updating UI based on
status, another checking comms).

/Matthew Jones/
Fri, Nov 15 2013 4:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< I would like to move a few images from right to left with some delay. >>

The next minor release has basic animation functionality for this built-in.
It's still a little crude, but it should work for you for these purposes.  I
should have it out by next Wednesday.

<< A timer could indeed work. However is it performance wise to use one or
more timers in the application? >>

Yes, timers are the way to go - they're pretty lightweight in a browser and
most JS applications use them *a lot*.

Tim Young
Elevate Software
www.elevatesoft.com
Image