When you get the reply, you subtract current ticks from the number you sent previously, and get the "lag". Ex:

//notice $me $ticks
on $*:NOTICE:/([0-9]+)/:*: {
if ($nick == $me) /echo Lag: $calc($ticks - $1)
}