Grasshopper

algorithmic modeling for Rhino

measuring the time elapsed for the execution of a script - vb component

Hi,

I would like to measure the time elapsed between the beginning and the end of a part of a script in a vb.net component. I want to use Timer for this. It  looks like :

Dim t_start As Single, t_end As Single, elapsed As Single

Dim As Long, s As String

t_start = Timer

My script here

t_end Timer
elapsed = CSng(Round(t_end - t_start, 2))

But I get an error message concerning the use of Timer ("Timer is a type and cannot be used as an expression").

Where is the problem ?

Views: 984

Replies are closed for this discussion.

Replies to This Discussion

Use System.Diagnostics.Stopwatch instead, it has better time keeping accuracy.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Works perfectly.

Thanks.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service