fix cpp support, fix calc_total_time issue, remove userdata in func call