timediff The timediff UDF computes the difference, in milliseconds, between two timestamps in the same row. From the session_rollup job, the timediff function computes the difference between the current time and the last activity in a session.