Added timing code, and directives for control