@@ -87,6 +87,7 @@ pub struct CheckTiming {
8787 resolve : f64 ,
8888 lower : f64 ,
8989 check : f64 ,
90+ total : f64 ,
9091}
9192
9293#[ derive( Serialize ) ]
@@ -103,6 +104,8 @@ pub fn check(source: &str) -> JsValue {
103104 let performance = get_performance ( ) ;
104105
105106 let result = ENGINE . with_borrow_mut ( |engine| {
107+ let total_start = performance. now ( ) ;
108+
106109 // Parse
107110 let start = performance. now ( ) ;
108111 let lexed = lexing:: lex ( source) ;
@@ -145,6 +148,7 @@ pub fn check(source: &str) -> JsValue {
145148 resolve : 0.0 ,
146149 lower : 0.0 ,
147150 check : 0.0 ,
151+ total : performance. now ( ) - total_start,
148152 } ,
149153 } ;
150154 }
@@ -171,6 +175,7 @@ pub fn check(source: &str) -> JsValue {
171175 resolve : 0.0 ,
172176 lower : 0.0 ,
173177 check : 0.0 ,
178+ total : performance. now ( ) - total_start,
174179 } ,
175180 } ;
176181 }
@@ -196,6 +201,7 @@ pub fn check(source: &str) -> JsValue {
196201 resolve : resolve_time,
197202 lower : 0.0 ,
198203 check : 0.0 ,
204+ total : performance. now ( ) - total_start,
199205 } ,
200206 } ;
201207 }
@@ -223,6 +229,7 @@ pub fn check(source: &str) -> JsValue {
223229 resolve : resolve_time,
224230 lower : lower_time,
225231 check : 0.0 ,
232+ total : performance. now ( ) - total_start,
226233 } ,
227234 } ;
228235 }
@@ -283,6 +290,8 @@ pub fn check(source: &str) -> JsValue {
283290 } ) ;
284291 }
285292
293+ let total_time = performance. now ( ) - total_start;
294+
286295 CheckResult {
287296 terms,
288297 types,
@@ -297,6 +306,7 @@ pub fn check(source: &str) -> JsValue {
297306 resolve : resolve_time,
298307 lower : lower_time,
299308 check : check_time,
309+ total : total_time,
300310 } ,
301311 }
302312 } ) ;
0 commit comments