]> git.lizzy.rs Git - frontend-next.git/commitdiff
feat(api): rst to html time
authorFuwn <fuwnzy@gmail.com>
Wed, 9 Mar 2022 09:50:39 +0000 (01:50 -0800)
committerFuwn <fuwnzy@gmail.com>
Wed, 9 Mar 2022 09:50:39 +0000 (01:50 -0800)
src/routes/api.svelte

index 89896e7fe77fa4452f446f8900f3d695c0a8e224..a6476da1214fd87df32c0e0d9eed6e0a57101216 100644 (file)
@@ -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>