I am pretty new to Ubuntu, but I can't seem to get this to work. It works fine on my school computers and I don't know what I am not doing. I have checked usr/include and time.h is there just fine. Here is the code:
using namespace std;
timespec time1, time2;
//do stuff here
-lrt to the end of g++ command line. This links in the librt.so "Real Time" shared library.