replaced ftimer and fixed warnings

replaced ftimer with clock_gettime which should have
higher resolution and is simpler.
fixed various warnings that appear on high warning
levels in gcc/clang.