Created
November 25, 2012 22:56
-
-
Save amosr/4145776 to your computer and use it in GitHub Desktop.
#include inside a function definition?!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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