From: Fuwn Date: Wed, 9 Mar 2022 09:50:39 +0000 (-0800) Subject: feat(api): rst to html time X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=0ad8ac5139174819eaf2b6d7d5cb16b3a42076c9;p=frontend-next.git feat(api): rst to html time --- diff --git a/src/routes/api.svelte b/src/routes/api.svelte index 89896e7..a6476da 100644 --- a/src/routes/api.svelte +++ b/src/routes/api.svelte @@ -20,11 +20,13 @@ SPDX-License-Identifier: GPL-3.0-only --> import rst2html from "rst2html"; import { baseURL } from "$lib/api"; - let rst; + let rst, rstTime; let complete = false; onMount(async () => { + rstTime = performance.now(); rst = await (await fetch(baseURL)).text(); + rstTime = performance.now() - rstTime; complete = true; }); @@ -47,5 +49,6 @@ SPDX-License-Identifier: GPL-3.0-only -->

Fetching API README...

{:else} {@html rst2html(rst)} +

RST to HTML time: {rstTime}ms

{/if}