Skip to content

Instantly share code, notes, and snippets.

@amosr
Created November 25, 2012 22:56
Show Gist options
  • Save amosr/4145776 to your computer and use it in GitHub Desktop.
Save amosr/4145776 to your computer and use it in GitHub Desktop.
#include inside a function definition?!
// from linpack benchmark. source: http://www.netlib.org/benchmark/linpackc
/*----------------------*/
REAL second()
{
#include <sys/time.h>
#include <sys/resource.h>
struct rusage ru;
REAL t ;
void getrusage();
getrusage(RUSAGE_SELF,&ru) ;
t = (REAL) (ru.ru_utime.tv_sec+ru.ru_stime.tv_sec) +
((REAL) (ru.ru_utime.tv_usec+ru.ru_stime.tv_usec))/1.0e6 ;
return t ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment