473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Display timer continuously through a long process

I am using a timer to display the time it takes a user to complete a
file transfer using the code below.
The code below will display the total elapsed time, but is there a way
to update the time continuously as the file is being downloaded?
Help is greatly appreciated,
lq

Public sngStart as Single
Public sngEnd as Single
Public sngElapsed as Single

Function CopyTheFrigginFile()

sngStart = Timer
Call FunctionThatStartsDownloadingTheBeast
sngEnd = Timer
sngElapsed = Format(sngEnd - sngStart,"Fixed")
Me.TimerDisplay = sngElapsed & " seconds"
End Function

Nov 13 '05 #1
6 4479
Lauren,
The syscmd object will let you put your own message in the Status bar. If
you use the Timer event of a form and set the Timer interval to ?1000? then
you can update the Status bar each second with the elapsed time.

"lauren quantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I am using a timer to display the time it takes a user to complete a
file transfer using the code below.
The code below will display the total elapsed time, but is there a way
to update the time continuously as the file is being downloaded?
Help is greatly appreciated,
lq

Public sngStart as Single
Public sngEnd as Single
Public sngElapsed as Single

Function CopyTheFrigginFile()

sngStart = Timer
Call FunctionThatStartsDownloadingTheBeast
sngEnd = Timer
sngElapsed = Format(sngEnd - sngStart,"Fixed")
Me.TimerDisplay = sngElapsed & " seconds"
End Function

Nov 13 '05 #2
On Fri, 25 Mar 2005 18:36:27 -0500, "Alan Webb" <kn*****@hotmail.com>
wrote:

But only if FunctionThatStartsDownloadingTheBeast yields the CPU.
-Tom.

Lauren,
The syscmd object will let you put your own message in the Status bar. If
you use the Timer event of a form and set the Timer interval to ?1000? then
you can update the Status bar each second with the elapsed time.

"lauren quantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googleg roups.com...
I am using a timer to display the time it takes a user to complete a
file transfer using the code below.
The code below will display the total elapsed time, but is there a way
to update the time continuously as the file is being downloaded?
Help is greatly appreciated,
lq

Public sngStart as Single
Public sngEnd as Single
Public sngElapsed as Single

Function CopyTheFrigginFile()

sngStart = Timer
Call FunctionThatStartsDownloadingTheBeast
sngEnd = Timer
sngElapsed = Format(sngEnd - sngStart,"Fixed")
Me.TimerDisplay = sngElapsed & " seconds"
End Function


Nov 13 '05 #3
Tom van Stiphout wrote:
On Fri, 25 Mar 2005 18:36:27 -0500, "Alan Webb" <kn*****@hotmail.com>
wrote:

But only if FunctionThatStartsDownloadingTheBeast yields the CPU.
-Tom.


I suspect even with judicious use of the DoEvents command that you won't
get a "very smooth" time display.

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #4
On Fri, 25 Mar 2005 21:30:08 -0600, John Mishefske
<mi************@JUNKtds.net> wrote:

Agreed. WM_TIMER events are lowest priority. Everything else is done
first; then the timer is updated (= the form_timer event fires).
I remember that I used to find this very strange when I first started
programming for Windows, but once I saw the multi-media timer that
*can* tick in a more reliable fashion, and what is needed to make that
happen, it made a lot of sense. "Stop everything; I need to update the
clock" doesn't make much sense in most applications.

-Tom.

Tom van Stiphout wrote:
On Fri, 25 Mar 2005 18:36:27 -0500, "Alan Webb" <kn*****@hotmail.com>
wrote:

But only if FunctionThatStartsDownloadingTheBeast yields the CPU.
-Tom.


I suspect even with judicious use of the DoEvents command that you won't
get a "very smooth" time display.


Nov 13 '05 #5
Guys,
Uhm, even on my P166 Hitachi Visionbook I was able to write things that
yielded the CPU and updated the status bar. The particular task was a 20
minute run to iterate through a four column, million plus row table stored
on my desktop machine and do a data conversion. With processors running
faster than 3Ghz and 1GB of RAM not such an unusual thing these days I'd
expect to see a monster task freezing the CPU. Plus, Windows XP seems much
better about multitasking than Windows 98. Anyway, syscmd should work.

"Tom van Stiphout" <no*************@cox.net> wrote in message
news:v6********************************@4ax.com...
On Fri, 25 Mar 2005 18:36:27 -0500, "Alan Webb" <kn*****@hotmail.com>
wrote:

But only if FunctionThatStartsDownloadingTheBeast yields the CPU.
-Tom.

Lauren,
The syscmd object will let you put your own message in the Status bar. If
you use the Timer event of a form and set the Timer interval to ?1000?
then
you can update the Status bar each second with the elapsed time.

"lauren quantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.google groups.com...
I am using a timer to display the time it takes a user to complete a
file transfer using the code below.
The code below will display the total elapsed time, but is there a way
to update the time continuously as the file is being downloaded?
Help is greatly appreciated,
lq

Public sngStart as Single
Public sngEnd as Single
Public sngElapsed as Single

Function CopyTheFrigginFile()

sngStart = Timer
Call FunctionThatStartsDownloadingTheBeast
sngEnd = Timer
sngElapsed = Format(sngEnd - sngStart,"Fixed")
Me.TimerDisplay = sngElapsed & " seconds"
End Function

Nov 13 '05 #6
Alan,
Thanks for the reply. I have to do this without using the Status bar
because I don't show it in this application (nor the Access window.)
And putting code in the form's OnTimer doesn't work because the CPU
doesn't yield during the FileCopy.
lq
Alan Webb wrote:
Lauren,
The syscmd object will let you put your own message in the Status bar. If you use the Timer event of a form and set the Timer interval to ?1000? then you can update the Status bar each second with the elapsed time.

"lauren quantrell" <la*************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I am using a timer to display the time it takes a user to complete a
file transfer using the code below.
The code below will display the total elapsed time, but is there a way to update the time continuously as the file is being downloaded?
Help is greatly appreciated,
lq

Public sngStart as Single
Public sngEnd as Single
Public sngElapsed as Single

Function CopyTheFrigginFile()

sngStart = Timer
Call FunctionThatStartsDownloadingTheBeast
sngEnd = Timer
sngElapsed = Format(sngEnd - sngStart,"Fixed")
Me.TimerDisplay = sngElapsed & " seconds"
End Function


Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: laurenq uantrell | last post by:
I have been using the following function to test the speed of various functions, however, quite often the return value is zero. I'm hoping someone can help improve on this. Function TimeIt() As...
1
by: Mamatha | last post by:
Hi I am developing a small application to capture a record a video file through webcam in C#.NET. In this application i created a JPEG images for every slide,means every JPEG image was treated...
1
by: karanam ravi kiran via DotNetMonster.com | last post by:
hi friends, i am fresher in the world of .net, i have problem to display time in asp.net web continuously. i want to display time on the form like the "live timer on windows task bar" plz help...
10
by: Bob | last post by:
Okay, I've done this for years but now I'm going to question it just because this idea has been at the back of my head since I started using DotNet... My WinForms app queries a database every 60...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
3
by: archana | last post by:
Hi all I am having application which is using server based timer that is timer from namespace system.timer. I am having windows service which i want to run everyday at some fix time. In...
4
by: Liverpool fan | last post by:
I have a windows application written using VB .NET that encompasses a countdown timer modal dialog. The timer is a System.Timers.Timer with an interval of 1 second. AutoReset is not set so accepts...
6
by: Aspiring .NET Programmer | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
4
by: Max | last post by:
This may be an elementary question but it's something I have not encountered in about 10 years writing code in VB 5 / 6 I have a timer that using the API checks if there has been a change to one...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.