Implementation of init_perfcounter