Skip to content

Commit cc9eceb

Browse files
Error in last display of context switch
1 parent f842cfe commit cc9eceb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,12 @@ function showFinalTable(input, output, outputDiv) {
559559
let tp = document.createElement("p");
560560
tp.innerHTML = "Throughput : " + process / lastct;
561561
outputDiv.appendChild(tp);
562+
if (input.contextSwitch > 0) {
562563

563-
let cs = document.createElement("p");
564-
cs.innerHTML = "Number of Context Switches : " + (output.contextSwitches - 1);
565-
outputDiv.appendChild(cs);
564+
let cs = document.createElement("p");
565+
cs.innerHTML = "Number of Context Switches : " + (output.contextSwitches - 1);
566+
outputDiv.appendChild(cs);
567+
}
566568
}
567569

568570
function toggleTimeLogArrowColor(timeLog, color) {

0 commit comments

Comments
 (0)