I’m a bit confused by the tic function, but I’m not sure if there’s something better for what I’m trying to do. In psuedo-Matlab:
startTime = tic
while(true)
#some_stochastic_process
if(now - startTime > RUNTIME)
break;
end
end
But subsequent calls to tic will clobber the original time. Is there a way to access the current value of tic without overwriting it?
The function NOW returns a serial date number (i.e. an encoded date and time). You should instead be pairing the call to TIC with a call to TOC to perform stopwatch-like timing, like so:
Alternatively, you could simplify your loop like so: