added debug option to output millisecond timing