diff options
| author | Fuwn <[email protected]> | 2022-03-09 01:50:39 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-09 01:50:39 -0800 |
| commit | 0428763bfe97ba6977727f693398fa8527ff23c0 (patch) | |
| tree | 3275088aa9c9b2f0a262bd71068b4ea4c95bee3c /src | |
| parent | refactor(api): get url from api wrapper (diff) | |
| download | frontend-next-0428763bfe97ba6977727f693398fa8527ff23c0.tar.xz frontend-next-0428763bfe97ba6977727f693398fa8527ff23c0.zip | |
feat(api): rst to html time
Diffstat (limited to 'src')
| -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> |