More manual information re #.delay()

Post Reply
User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

More manual information re #.delay()

Post by rbytes »

I was experimenting with #.delay() while porting the Turtle Graphics program into SPL. Some graphic operations require a very slight slowdown between iterations. While testing, I found that values less than #.delay(.001) had no effect on the program execution. If indeed .001 is the smallest possible delay, perhaps this should be mentioned. If delays are calculated in thousandths of a second and this info is included in the manual, then programmers would realize that .0009 is no delay at all, and there is no difference between delays of .0044 and .004
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: More manual information re #.delay()

Post by Mr. Kibernetik »

Thank you for your note.
Yes, currently #.delay precision is 1 millisecond.
Probably I need to increase #.delay precision.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: More manual information re #.delay()

Post by rbytes »

That would be useful. Right now I am caught between a too-slow delay of .001 and a too-fast delay of .0005 which seems to equal no delay.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: More manual information re #.delay()

Post by Mr. Kibernetik »

#.delay precision will be improved in version 0.0.23.

You can create small delays by executing empty code, for example:

Code: Select all

delay(x)=
  > i, 1..x
  <
.
Of course this is not a time-based delay, but it can give as small delays as you need.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: More manual information re #.delay()

Post by rbytes »

That is very helpful. Thanks.
The only thing that gets me down is gravity...

Post Reply