defined timer class function