How to call a C-routine from Fortran

There is usually not major problem to call C-routines from C and vice-versa (as long as the parameters are arrays and scalars). This is the way to use fsecond.

program examp
double precision :: fsecond, t

t = fsecond()
! compute ...
t = fsecond() - t

print*, 'time = ', t

end program examp

and this is how you compile and link:
 


Back