What would be a good way to create a timer in R. One that would require little system resources.
So far I have a simple delay:
t1=as.numeric(format(Sys.time(), "%s"));
t2=t1;
while (t2-t1<5) t2=as.numeric(format(Sys.time(), "%s"));
And the corresponding timer:
t1=as.numeric(format(Sys.time(), "%s"));t2=t1;
[Event]
t2=as.numeric(format(Sys.time(), "%s"));
time=t2-t1;
Thanks for reading.