Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Ticks to calculate number of seconds with two deci
Message
De
04/04/2006 17:41:17
 
 
À
04/04/2006 17:29:21
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01110385
Message ID:
01110441
Vues:
9
>DateTimes have a 1-tick granularity, so they are good for timing stuff. The only thing that could negatively affect a simple DateTime based timer is that its thread may get interrupted between the last statement inside the timing block and the call to DateTime.Now.
>
>If you really want a hardcore timer, you'd have to enclose the entire batch in a synclock.

I used something like this and it works well:
' Initialize at first
Framework.App.nDateNow = Date.Now.Ticks

' Do the code here

' At the end, we can now obtain the elapsed time
Dim lnDateNow As Double = Date.Now.Ticks
Dim lnElapse As Double
lnElapse = ((lnDateNow - Framework.App.nDateNow) / 10000000)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform