Re: now.ticks does not work
- From: "Willie jan" <unknown@xxxxxxxxxx>
- Date: Thu, 18 Aug 2005 10:39:59 +0200
my sleep was 3 ms, so it should show it.
the strange thing is, sometimes you get a value >0, but not always.
I use this to determine the database call time used.
"Armin Zingler" <az.nospam@xxxxxxxxxx> schreef in bericht
news:u39p$JzoFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
> "Willie jan" <unknown@xxxxxxxxxx> schrieb
>> 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
>
> Dim t as long
>
> Ticks is long, not double.
>
>> T = Now.Ticks
>>
>> System.Threading.Thread.Sleep(3)
>>
>> T = Now.Ticks - T
>>
>> ListBox1.Items.Insert(0, T.ToString("0000000000000000"))
>
>
> The *unit* of Now.Ticks is 100 nano seconds.
> The *resolution* is AFAIR 0.01 seconds.
>
> Sleep longer than 0.01 seconds and you'll see a difference.
>
> Higher resolution: Environment.Tickcount.
> Even higher resolution: High performance counter. (see
> QueryPerformanceCounter and QueryPerformanceFrequency API functions)
>
>
>
>
> Armin
.
- Follow-Ups:
- Re: now.ticks does not work
- From: Armin Zingler
- Re: now.ticks does not work
- References:
- now.ticks does not work
- From: Willie jan
- Re: now.ticks does not work
- From: Armin Zingler
- now.ticks does not work
- Prev by Date: Re: now.ticks does not work
- Next by Date: Re: now.ticks does not work
- Previous by thread: Re: now.ticks does not work
- Next by thread: Re: now.ticks does not work
- Index(es):