Re: now.ticks does not work
- From: Ross Presser <rpresser@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 10:20:00 -0400
On Wed, 17 Aug 2005 15:41:31 +0200, Willie jan wrote:
> place this behind a button that fills a listbox.
> as you will see the time is now and then 0 or filled in????????????
> by hitting the button.
>
> is there a way to determine the real elapsed time?
>
> thanks, Willie
>
> Dim T As Double
>
> T = Now.Ticks
>
> System.Threading.Thread.Sleep(3)
>
> T = Now.Ticks - T
>
> ListBox1.Items.Insert(0, T.ToString("0000000000000000"))
Not sure what's wrong with your code, but here's what I would have done:
Dim T as DateTime
T = Now
System.Threading.Thread.Sleep(3)
Dim D as TimeSpan
D = Now.Subtract(T)
ListBox1.Items.Insert(0, D.ToString())
.
- Follow-Ups:
- Re: now.ticks does not work
- From: Willie jan
- Re: now.ticks does not work
- From: Willie jan
- Re: now.ticks does not work
- References:
- now.ticks does not work
- From: Willie jan
- now.ticks does not work
- Prev by Date: 20,20 is not a valid value for Int32?
- Next by Date: Instancing a class where base object already exists
- Previous by thread: Re: now.ticks does not work
- Next by thread: Re: now.ticks does not work
- Index(es):