#include "phish.h" double t1 = phish_timer(); ... double t2 = phish_timer(); printf("Elapsed time = %g\n",t2-t1);
#include "phish.hpp" double t1 = phish::timer(); ... double t2 = phish::timer(); printf("Elapsed time = %g\n",t2-t1);
import phish t1 = phish.timer(); ... t2 = phish.timer(); print "Elapsed time =",t2-t1
This is a PHISH library function which can be called from a minnow application. In PHISH lingo, a "minnow" is a stand-alone application which makes calls to the PHISH library.
This function provides a portable means to time operations within a minnow. The function returns the current wallclock time as a timestamp measured in seconds. To calculate an elapsed time, you need to bracket a section of code with 2 calls to phish_timer() and compute the difference between the 2 returned times, as in the example above.
Related commands: none