From d989e1e942a77749c31e82296dd6c83a97184fd0 Mon Sep 17 00:00:00 2001
From: Jan Tuomi <jans.tuomi@gmail.com>
Date: Tue, 8 Feb 2022 17:45:04 +0200
Subject: Show timing info

---
 src/Editor.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/Editor.tsx')

diff --git a/src/Editor.tsx b/src/Editor.tsx
index 8cf6901..f549fc8 100644
--- a/src/Editor.tsx
+++ b/src/Editor.tsx
@@ -87,7 +87,10 @@ const Editor = () => {
           </div>
         )
       case "success": {
-        const text = `Output:\n${result.data}`
+        const apiTimeMillis = (result.data.apiTime / 1000).toFixed(1)
+        const executionTimeMillis = (result.data.executionTime / 1000).toFixed(1)
+        const roundtripTime = (result.data.roundtripTime).toFixed(1)
+        const text = `Output:\n${result.data.result}\nTotal roundtrip time: ${roundtripTime} ms\nServer processing time: ${apiTimeMillis} ms\nExecution time: ${executionTimeMillis} ms`
         return (
           <AceEditor
             mode=""
-- 
cgit v1.3

