[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Delaying Code Execution for x milliseconds

Posted on 1998-10-27
2
Medium Priority
?
269 Views
Last Modified: 2010-04-30
This should be simple for most of you.

I need to draw a graph in slow-motion so that people can see the drawing process step-by-step.

All I need to know is how to delay code execution at run-time in VB5. I know that in C++, all you need is the "delay" keyword followed by the no. of milliseconds.
But how do I do it in VB5 ? Can I do it without the timer control ?

Thanks
0
Comment
Question by:xoooox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
zivf earned 100 total points
ID: 1442004
you need to run a loop, and using the timer() function will be the most accurate. it returns the number of seconds since last midnight, and at least 2 more digits accurate to the right of the decimal point.
tmr = timer()
do while timer() < (tmr + wait_time)
    ' here you can put DoEvents if you want other tasks
    ' to get CPU time
loop
0
 

Expert Comment

by:BHimmerick
ID: 1442005
I believe this is the code you are looking for.

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Just call Sleep for it to pause the number of Milliseconds you want it to.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question