Best approach to measure worked joint time

Hi!

I want to measure the worked time for each joint in a robot, by now my approach is to start a daemon, read the real time communication package, check if the joint is moving and record the worked time for each joint. I was wondering is there any better way to accomplish this task? It sound like a basic work that should be implemented somehow but I can’t find other ways that help me doing it.

Thanks for the help.