move state duration calc from email.rb to processor.rb