diff options
| author | Fuwn <[email protected]> | 2022-03-09 01:50:39 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-09 01:50:39 +0000 |
| commit | ab7997eb49d144ba91a5e126f22f228ceab08c79 (patch) | |
| tree | 3275088aa9c9b2f0a262bd71068b4ea4c95bee3c | |
| parent | refactor(api): get url from api wrapper (diff) | |
| download | archived-frontend-next-ab7997eb49d144ba91a5e126f22f228ceab08c79.tar.xz archived-frontend-next-ab7997eb49d144ba91a5e126f22f228ceab08c79.zip | |
feat(api): rst to html time
| -rw-r--r-- | src/routes/api.svelte | 5 |
1 files changed, 4 insertions, 1 deletions
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; }); </script> @@ -47,5 +49,6 @@ SPDX-License-Identifier: GPL-3.0-only --> <p>Fetching API README...</p> {:else} {@html rst2html(rst)} + <p>RST to HTML time: {rstTime}ms</p> {/if} </section> |