clibs / bench Goto Github PK
View Code? Open in Web Editor NEWget wall and cpu time for benchmarking
get wall and cpu time for benchmarking
How do you feel about that?
Hey guys, I got some errors when I try to compile it.
The git HEAD is ce7b114
bench git:(master) make
rm -f bench *.o
cc test.c -c -o test.o -std=c99 -Wall -Wextra -lrt
In file included from test.c:4:0:
bench.h: In function ‘wall’:
bench.h:51:19: error: storage size of ‘tp’ isn’t known
struct timespec tp;
^
bench.h:52:3: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
clock_gettime(CLOCK_SUITABLE, &tp);
^
bench.h:46:26: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
# define CLOCK_SUITABLE CLOCK_MONOTONIC
^
bench.h:52:17: note: in expansion of macro ‘CLOCK_SUITABLE’
clock_gettime(CLOCK_SUITABLE, &tp);
^
bench.h:46:26: note: each undeclared identifier is reported only once for each function it appears in
# define CLOCK_SUITABLE CLOCK_MONOTONIC
^
bench.h:52:17: note: in expansion of macro ‘CLOCK_SUITABLE’
clock_gettime(CLOCK_SUITABLE, &tp);
^
bench.h:51:19: warning: unused variable ‘tp’ [-Wunused-variable]
struct timespec tp;
^
bench.h: In function ‘cpu’:
bench.h:58:19: error: storage size of ‘tp’ isn’t known
struct timespec tp;
^
bench.h:59:17: error: ‘CLOCK_PROCESS_CPUTIME_ID’ undeclared (first use in this function)
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp);
^
bench.h:58:19: warning: unused variable ‘tp’ [-Wunused-variable]
struct timespec tp;
^
bench.h: In function ‘wall’:
bench.h:54:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
bench.h: In function ‘cpu’:
bench.h:61:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Makefile:20: recipe for target 'test.o' failed
make: *** [test.o] Error 1
there doesn't seem to be a librt
package for osx :(
is there any possibility of adding osx support?
how would one go about using this utility?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.