Then you'd have to set a variable to the value of $ticks when you send the ctcp ping, and do $calc($ticks - %var) when you get the response.