use gettimeofday and make lthraed compile using clang