Set $CMD_DURATION to milliseconds. Fixes #1585