LB Booster
« timer 0, [label] »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:36am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: timer 0, [label]  (Read 613 times)
tsh73
Guest
xx timer 0, [label]
« Thread started on: Feb 18th, 2013, 05:43am »

Just found something.
Works in JB:
Code:
t0=time$("ms")
timer 0, [label]    'like, minimal possible timer delay?
wait
[label]
timer 0                'timer off
t1=time$("ms")
print "dt", t1 - t0
 

Reports smallest possible timer delay (16 ms for my XP)
In LBB (1.80, sorry if not latest)
errors with "duplicate label".
That's at least misleading error message.

Actually, meaning will not change if code
Code:
timer 1, [label] 

- and it will work in LBB as well as in JB.
User IP Logged

tsh73
Guest
xx Re: timer 0, [label]
« Reply #1 on: Feb 18th, 2013, 05:50am »

(I see current version is 1.86.
Obviously I did not upgraded because 1.80 worked fine for me so far.
I cannot download it while at work, I will try to do it at home and check on current version)
User IP Logged

tsh73
Guest
xx Re: timer 0, [label]
« Reply #2 on: Feb 18th, 2013, 4:01pm »

Confirmed: works the same in LBB 1.86
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: timer 0, [label]
« Reply #3 on: Feb 19th, 2013, 08:28am »

on Feb 18th, 2013, 05:43am, Guest-tsh73 wrote:
Just found something.
Works in JB:
Code:
t0=time$("ms")
timer 0, [label]    'like, minimal possible timer delay? 


My understanding is that the syntax TIMER 0 means 'deactivate the timer', in which case adding a label afterwards doesn't make sense. As far as LBB is concerned it sees the label as the start of the next statement, hence the 'duplicate label' error message.

If you want to get the smallest-possible delay why would you not use TIMER 1, [label]? Windows timers cannot have a smaller resolution than 1 millisecond.

Richard.
User IP Logged

tsh73
Guest
xx Re: timer 0, [label]
« Reply #4 on: Feb 20th, 2013, 04:28am »

Hello Richard
Well, I might as well use "timer 1, [label]" (and probably would in the future) - it just worked with 0 in JB/LB no problem.
As for
Quote:
My understanding is that the syntax TIMER 0 means 'deactivate the timer', in which case adding a label afterwards doesn't make sense.

LB Help says
Quote:
The TIMER is deactivated by setting a time value of 0, and no branch label.

I interpret it differently then you said.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls