algorithmic modeling for Rhino
Hi Mateusz,
which "iteration"?
Thread.Sleep(int) will suspend the current thread for N milliseconds, meaning nothing whatsoever happens in this interval.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
i.e. :
Dim x as integer = 1
While x <= 10
x = x + 1
Print(CStr(x))
'I Want to print every x with interval of 1000 ms.
'So the list of values will update every second.
End While
While should be executed every second not as fast as its possible.
So list of values will look like : "1", after one second "1,2", after 2 seconds "1,2,3" etc.
Well, in that case Thread.Sleep(1000) is exactly what you need. Or do you want other stuff to continue happening in between?
If so, this is quite difficult. I could get into quite a long rant about timers and multi-task time-slices and threads and race-conditions and invokes, but if you want to make something which causes a new solution 1 second after the previous solution completed, you should have a look at GH_Document.ScheduleSolution (see attached).
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by