PHISH WWW Site - PHISH Documentation - Bait.py Commands

phish_timer() function

C syntax:

double phish_timer() 

C examples:

#include "phish.h"
double t1 = phish_timer();
...
double t2 = phish_timer();
printf("Elapsed time = %g\n",t2-t1); 

C++ syntax:

double timer() 

C++ examples:

#include "phish.hpp"
double t1 = phish::timer();
...
double t2 = phish::timer();
printf("Elapsed time = %g\n",t2-t1); 

Python syntax:

def timer() 

Python examples:

import phish
t1 = phish.timer();
...
t2 = phish.timer();
print "Elapsed time =",t2-t1 

Description:

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.

Restrictions: none

Related commands: none