You can do it the same way, if that's how it has to be
done:
DateTime markTime = DateTime.Now;
do{
if(DateDiff("s",markTimer,DateTime.Now) >= 2){
break;
}
// some code...
} while(...);
If you want your timeout to be EXACT, I'd use threading
and abort your thread when a specific time period elapses.
JER
-----Original Message-----
How can i do a time out based on seconds or milliseconds.
I need to exit loops based on a time value.
The VB6 equiv is:
Dim markTime As Date
marktime=Now
If DateDiff("s",markTime,Now).2 then exit do
Thanks
-Lou
.