ros::Time::now() gives you an actual time stamp as an object. toSec() just converts this into a double represenation in seconds. Subtracting time stamps and calling toSec() on this should work and give you correct results.