gemini-code-assist[bot] commented on code in PR #18450:
URL: https://github.com/apache/tvm/pull/18450#discussion_r2527392719


##########
web/src/runtime.ts:
##########
@@ -1421,6 +1421,12 @@ export class Instance implements Disposable {
           throw err;
         }
       }
+      if (i === 0) {
+        // Reset for the loading phase to avoid double counting with download 
phase.
+        fetchedBytes = 0;
+      }
+      fetchedBytes += shard.nbytes;
+      timeElapsed = Math.ceil((perf.now() - tstart) / 1000);

Review Comment:
   You're right that this change aligns with the existing pattern in the file, 
specifically on line 1360. My suggestion to use `Math.round` was based on the 
general principle that rounding elapsed time to the nearest whole number 
(rather than always rounding up with `Math.ceil`) often provides a more 
intuitive and less misleading experience for users, especially for very short 
durations.
   
   While maintaining consistency within the current PR is a valid approach, it 
might be worth considering a separate, broader refactoring effort to update all 
`timeElapsed` calculations to `Math.round` across the file (or even the 
codebase) in a future change, if improving user experience for time reporting 
is desired. For this PR, keeping it consistent with the existing `Math.ceil` is 
understandable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to