difftime returns the elapsed time in seconds, from timer0 to timer1. The value returned is a double-precision, floating-point number.
Return value:
the elapsed time in seconds, from timer0 to timer1.
Example
import standard.C.time
class Main {
function Main() {
var start=time();
echo "Something to do ...\n";
for (var i=0;i<20000000;i++) {
// NOTHING
}
var end=time();
echo "Elapsed : " + difftime(end,start) + " seconds";
}
}
Results
Something to do ...
Elapsed : 2 seconds