Elaborate

by Minty (no login)

 
I read this before I posted it, and it looks like I need to first make the following brief statement: This is not a rant ;) I'm not mad
=^_^=

Could you elaborate on TIMER? Since my code works fine, I don't see that I have a problem. I've heard of TIMER, but I didn't learn QBasic from a book or from any person. I mucked around with it as a 9th grade student of nothing more closely related to it than a typing class where we were taught on -- get this -- typewriters, OMG! -- until I figured out how to make it do what I wanted it to do. I hadn't even heard of the internet back then! I don't know how you're supposed to do certain things. I only know what works.

The little programming ethics I know come from a c++ class I took in college a few years ago trying desperately (and failing) to learn a programming language that would give me a useful point on my resume. My brief experience with c++ gives me an understanding of many of the points made by the OP, and I've since made a lot of subs that sort of act like elements of c++ (cecho, inc, etc), but ultimately, I couldn't seem to get c++ to work on its own, and I've gradually fallen back to using LOCATE and x = x + 1 and FOR .. NEXT.

But if you believe time fragments smaller than one second can't be timed in QBasic, how would TIMER be helpful, keeping in mind that my code is very short, very quick, and works accurately to a 15000th of a second on my computer?

Just now, I wrote the following quick program to test how well time is preserved with my SNOOZE when compared with SLEEP:

PRINT TIME$
SNOOZE 60
PRINT TIME$
SLEEP 60
PRINT TIME$
SNOOZE 60
PRINT TIME$
SLEEP 60
PRINT TIME$
SYSTEM

Here is the output after 4 minutes:

32:11:43
32:11:42
32:11:42
32:11:42
32:11:42

I'd run it for an hour to get an even closer estimate on how accurate my timer is, but ironically, I don't have time right now. It'll be 33 o'clock soon, time for breakfast!

Posted on Nov 19, 2010, 8:42 AM

Respond to this message   

Return to Index

Response TitleAuthor and Date
* NOPE, you apparently know TOO MUCH ALREADY!Clippy on Nov 19
 Attitude much?Minty on Nov 19
  * Don't feel bad. I mistook YOU for a programmer, :-OClippy on Nov 19
   It's an easy mistake to make.Minty on Nov 19
    Don't mind Clippy...Pete on Nov 19
     I'm not here to push anybody out ;)Minty on Nov 19
      OK, if you INSIST!Clippy on Nov 20
       ICMinty on Nov 20
        SNOOZE does work...Pete on Nov 20
         Don't mind Pete. He SELLS his code!Clippy on Nov 20
         I'm running MacMinty on Nov 20
         I think it should be pointed out that Minty's concept is valid...TheBOB on Nov 20
          Bob, post the code that YOU are using. It doesn't work the way I have it!Clippy on Nov 20
           I just used Minty's code, except...TheBOB on Nov 20
            Try this code Bob. I even get the right loop counts, but no delay.Clippy on Nov 20
             I assume you're running it in QB64...TheBOB on Nov 20
              Alright, I added one line of code -- try this in QB64...TheBOB on Nov 20
               It works BETTER in QB64 than Qbasic on my XP.Clippy on Nov 20
                *Yeah, in QB/DOSBox loops are slo-o-ow, which is why it "sort of" worked there.TheBOB on Nov 21
                 CPU Speed can be adjusted in DOSBoxMinty on Nov 21
                  Well, I never heard of a TIMER that didn't reset at midnite either.Clippy on Nov 21
                   DOSBox is weird that way...TheBOB on Nov 21
                    Well I have DOSBOX, but I'm not planning on making a habit of it.Clippy on Nov 21
                   It resets to the actual time when I start DOSBoxMinty on Nov 21
  I like this guy!!!Unseen Machine on Nov 28

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement