diff --git a/static/duration.mjs b/static/duration.mjs new file mode 100644 index 0000000..80de5c0 --- /dev/null +++ b/static/duration.mjs @@ -0,0 +1,20 @@ +/** + * A time duration. + * + * JavaScript uses milliseconds in most (but not all) places. + * I've found it helpful to be able to multiply by a unit, so it's clear what's going on. + * + * @typedef {number} Duration + */ + +/** @type {Duration} */ +export const Millisecond = 1 + +/** @type {Duration} */ +export const Second = 1000 * Millisecond + +/** @type {Duration} */ +export const Minute = 60 * Second + +/** @type {Duration} */ +export const Hour = 60 * Minute diff --git a/static/index.html b/static/index.html index 6d37aef..a55d415 100644 --- a/static/index.html +++ b/static/index.html @@ -5,10 +5,9 @@ - - - - + + + @@ -18,50 +17,46 @@
-