So this returns a value in ms into a variable called 'r_ticks'?  Something is very wrong with the names here.  Does this function want ticks or ms?