tugas3-openMP/graph.html
gabrielkheisa fcabd6b5e0 add
2022-11-16 19:59:19 +07:00

47 lines
838 B
HTML

<!DOCTYPE html>
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<body>
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>
<script>
var xValues = [1,2,4,8,16,32,64];
var data = [227.454, 115.605, 60.774, 30.498, 26.556, 24.960, 24.707];
var d_data = [];
var speedup = [1, 1.97, 3.8, 7.19, 12.9, 21.4, 31.8];
var i = 1;
while(i < data.length){
d_data[i] = data[i+1] - data[i];
i++;
}
/*
1 Thread: 227.454 sec
2 Thread: 115.605 sec
4 Thread: 60.744 sec
8 Thread: 30.498 sec
16 Thread: 26.556 sec
32 Thread: 24.960 sec
64 Thread: 24.707 sec
*/
new Chart("myChart", {
type: "line",
data: {
labels: xValues,
datasets: [{
data: data,
borderColor: "black",
fill: false
}]
},
options: {
legend: {display: false}
}
});
</script>