A new project
by Gabriel G
Tags: Deno, Markdown
The markdown in this post is rendered by react-markdown and its remark-gfm plugin.
This enables several extensions to markdown like footnotes1.
- And checklists too!
- Cool, right?
Here is some code rendered by rehype-highlight:
export async function timed<T>(
task: Promise<T> | (() => T | Promise<T>),
): Promise<{ value: T; duration: Temporal.Duration }> {
const start = performance.now();
const value = await (typeof task === "function" ? task() : task);
const end = performance.now();
return {
value,
duration: Temporal.Duration.from({
microseconds: Math.round(1_000 * (end - start)),
}),
};
}
Footnotes
-
This is a cool footnote! ↩