parse duration (accept ms|s|m|h)