in reply to getting the return value from a C program
I know I can do a printf (or cout) and capture the standard out in the perl script, but is there a way to in-line a C function/program and get the return value?
Sure! You could do an XS interface, or use Inline::C.
The main reason I am asking this is to get the output from the C function gettimeofday so that I can get the time at micro second granularity.
Oh!No need to complicate then: just use Time::HiRes, and it will make gettimeofday available to you as a function.
|
|---|