thorium_node: move time delta computation in function

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>