http://qs321.pair.com?node_id=1150882


in reply to Using module with c code in perl program.

In the perl portion, I think this line:
$elapsed_c = tv_interval($start_time,$end_time);
should be this:
$elapsed_c = tv_interval($start_time_c,$end_time_c);
and
$elapsed_perl = tv_interval($start_time,$end_time);
should be:
$elapsed_perl = tv_interval($start_time_perl,$end_time_perl);
Note that $start_time and $end_time are never declared, nor initialized, and a "use strict;" at the top would have helped you spot this.