Use the CPU timer provided by TPIE

TPIE provides a CPU timer implementation, no need to implement my own