add measure_token method