473,322 Members | 1,431 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,322 software developers and data experts.

Stopwatch / Countup in VB.NET

Hi, I've done some reasearch to be able to find the best way of acheiving this, but have been unlucky so far.

What I'm trying to do is create a stopwatch on a .net page, whereby when a user clicks the "start" button, the timer begins to count up and displays a real-time timer (I'd prefer an Ajax method) to avoid postbacks. The start time will also be saved to the databse.

Upon clicking stop, the timer will display the elapsed time and save the stop time in the database as well.

I have no problems achieving any of the above, except for displaying the "count up" timer in a ajax/javascript way, so that the page is not refreshing and a smooth timer is displayed.

I've achieved the complete sceanrio using the AJAX Timer control, but it does not provide the visual feel that I'm looking for. The display updates, but not smoothly, and the status bar on the window keeps refreshing based on the interval I had set. Any help would be greatly appreciated.
Jul 9 '07 #1
1 2850
kenobewan
4,871 Expert 4TB
I believe that the only way for this to work, as you have discovered, is for page to refresh client side or round trip to the server. There are ways to not get the rest of the page to refresh, eg inside something else. Another idea possibly animated image to display time passing when time started, then image not visible when time stops and label gives the result. For - page only refreshes twice. Cons - animated images can be large files. HTH.
Jul 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: luckyjameel | last post by:
Hi Guys Hope this message shall find u all in gr8 moods. As i was developing a Application for Online Exam and i am in need of a way to maintain the time for the logged in user. So Can any one...
5
by: Xero | last post by:
I have written a program that functions similarly to a stopwatch. When the user clicks the button, a label on the form starts counting. The program, however, does not tick once a second. How can I...
1
by: Anirhudra | last post by:
Could you anyone can help me how can I send a Stopwatch Javascript value send it through PHP file .... this is my time JavaScript file ... var timercount = 0; var timestart = 0; function...
5
by: not_a_commie | last post by:
So I have a motherboard with multiple CPU sockets. It seems that if I create a StopWatch on one thread and then call the Elapsed member from a different thread that sometimes I get a tick count...
3
by: Jeff Jarrell | last post by:
I am unable to add up two timespans as created by the System.Diagnostics.Stopwatch class. Each stopwatch should be about two seconds and is appears ok, but when I try and add them up it goes to...
1
by: =?Utf-8?B?UmFqYQ==?= | last post by:
I am running a sample application that gives me performance time for each action. I am using Stopwatch class (found in System.Diagnostics namespace in ..Net 2.0) to get the Elapsed time. If I run...
4
by: PlusNet | last post by:
Why doesn't the following work? Dim MyStopwatch() as Stopwatch ...Later in the code redim preserve MyStopwatch(10) ...Later in the code MyStopwatch(1).start
8
by: Firecore | last post by:
Hello. I am making a Stopwatch program in C. Can anyone help? Is it possible to make a timer(stopwatch) function in C?
0
by: kerplunkwhoops | last post by:
Hello I am wanting to use the high accuracy of System.Diagnostics.Stopwatch to get the current time using GetTimeSpan. Underneath, System.Diagnostics.Stopwatch.GetTimeStamp uses the win32 API...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.