timer starts from 00:00:00

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2006
Posts: 2
Reputation: psychedelic is an unknown quantity at this point 
Solved Threads: 0
psychedelic psychedelic is offline Offline
Newbie Poster

timer starts from 00:00:00

 
0
  #1
Jan 16th, 2006
hey.. again i wud like to ask for ur help..
im a really newbie to vb6 n a really stupid one..
so.. my teacher want me to test the time on how long does da program save the file to database..
so i have to put timer.. on save capture form,
it has to start from 00:00:00:00 (hr:min:seconds:millisnds) or just min:seconds:millis
so when i click save command button it starts counting and if the file has been saved on da database da timer stops counting, n i can see how long does it takes to save a file to database.. on a label..

i found some articles(on here).. but cant seem to edit it the way i want.. (im sorry for da stupidness)
here is one article i found
http://www.daniweb.com/techtalkforums/thread17352.html
most of it are countdowns and print current time, what i need is start from zero.. 00:00:00:00

can anyone help me?im not good in editing code or anything..
i mean really help me, like in dat forum.. helping me with the code..
thanks aaaaaaaaaaaa lottttttttt
help me..
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 40
Reputation: beuls is an unknown quantity at this point 
Solved Threads: 2
beuls beuls is offline Offline
Light Poster

Re: timer starts from 00:00:00

 
0
  #2
Jan 17th, 2006
keep separate timers for seconds, minutes and hours.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 40
Reputation: beuls is an unknown quantity at this point 
Solved Threads: 2
beuls beuls is offline Offline
Light Poster

Re: timer starts from 00:00:00

 
0
  #3
Jan 17th, 2006
or try this in vb.net

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = Convert.ToString(DateTime.Now.Hour) + ":" + Convert.ToString(DateTime.Now.Minute) + ":" + Convert.ToString(DateTime.Now.Second)
End Sub
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 2
Reputation: psychedelic is an unknown quantity at this point 
Solved Threads: 0
psychedelic psychedelic is offline Offline
Newbie Poster

Re: timer starts from 00:00:00

 
0
  #4
Jan 17th, 2006
Originally Posted by beuls
or try this in vb.net

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = Convert.ToString(DateTime.Now.Hour) + ":" + Convert.ToString(DateTime.Now.Minute) + ":" + Convert.ToString(DateTime.Now.Second)
End Sub
but im using vb 6..
i duno how .net works..
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 40
Reputation: beuls is an unknown quantity at this point 
Solved Threads: 2
beuls beuls is offline Offline
Light Poster

Re: timer starts from 00:00:00

 
0
  #5
Jan 22nd, 2006
try this code pls

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim hr%, m%, s%
  2. Private Sub Form_Load()
  3. hr = 0
  4. m = 0
  5. s = 0
  6. End Sub
  7.  
  8. Private Sub hour_Timer()
  9. hr = hr + 1
  10. End Sub
  11.  
  12. Private Sub min_Timer()
  13. m = m + 1
  14. End Sub
  15.  
  16. Private Sub sec_Timer()
  17. s = s + 1
  18. Label1.ForeColor = RGB(hr, m, s)
  19. Label1.Caption = hr & ":" & m & ":" & s
  20.  
  21. End Sub

Adjust the intervals of timers as per ur wish
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 51
Reputation: tom curren is an unknown quantity at this point 
Solved Threads: 3
tom curren's Avatar
tom curren tom curren is offline Offline
Unverified User

Re: timer starts from 00:00:00

 
0
  #6
Jan 27th, 2006
use the timer function
or use a timer control

either works great.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC