Is there a way to delay less than a second?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
giwake
Newbie
Posts: 2
Joined: Wed Jul 27, 2016 4:33 am

Is there a way to delay less than a second?

Post by giwake »

I'm trying to make a demoscene/animation and I can't find any way to wait less than a second.
Please don't reply with

Code: Select all

 for x = 1 to 9999999999999
 next
Because my PC is WAYY too fast.
Thanks,
giwake
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: Is there a way to delay less than a second?

Post by burger2227 »

TIMER can be used down to 1/18th of a second: http://www.qb64.net/wiki/index.php/TIMER

You can use _DELAY in QB64 only for delays of less than one second down to .001
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
giwake
Newbie
Posts: 2
Joined: Wed Jul 27, 2016 4:33 am

Re: Is there a way to delay less than a second?

Post by giwake »

Thanks! :)
mikefromca
Coder
Posts: 41
Joined: Wed Oct 16, 2019 11:28 am

Re: Is there a way to delay less than a second?

Post by mikefromca »

That makes a delay of 0.1 seconds (1/10th) of a second. Adjust the number to suit your fancy.

Code: Select all

start#=timer
Do
loop until (timer - start#) >= 0.1
Post Reply