function parseTime(str) {
				if (!str) {
					return 0;
				}

				const strings = str.split(":");
				const l = strings.length;
				let i = l;
				let ms = 0;
				let parsed;

				if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
					throw new Error(
						"tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits"
					);
				}

				while (i--) {
					parsed = parseInt(strings[i], 10);

					if (parsed >= 60) {
						throw new Error(`Invalid time ${str}`);
					}

					ms += parsed * Math.pow(60, l - i - 1);
				}

				return ms * 1000;
			}
Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into
number of milliseconds. This is used to support human-readable strings passed
to clock.tick()

@param {string} str
@returns {number}