I assume you're running it in QB64...by (Login qb432l)
My results were more consistent in QBasic/DOSBOx, but not in QB64. The reason is simple. During the loop that measures the speed of the user's computer, there is a test with each iteration to see if TIME$ has incremented. There is no such test in the loop that makes use of the value thus generated -- the delay loop. As a result, the delay loop executes more rapidly than the test loop, and in QB64, almost immediately. I would suggest using a test of some sort in the delay loop for more consistency.
In any event, this is the type of discussion that we should have been having about Minty's code, not merely dismissing it as foolishness.
|Response Title||Author and Date|
|Alright, I added one line of code -- try this in QB64...||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.||on Nov 21|
|CPU Speed can be adjusted in DOSBox||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...||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 DOSBox||on Nov 21|