From 3bb1fd3b49b02752337f0c6b45c0d4fa20a7215d Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Tue, 18 Nov 2025 14:32:05 -0800 Subject: [PATCH] Feat: Display both Average and Median optimal temperatures --- gemini.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gemini.html b/gemini.html index b9306a9..0cef6be 100644 --- a/gemini.html +++ b/gemini.html @@ -78,11 +78,25 @@ } if(stats.length){ const max=Math.max(...stats.map(x=>x.r)); - const best=stats.filter(x=>x.r===max); - const optimal=(best.reduce((a,c)=>a+c.t,0)/best.length).toFixed(2); + const best=stats.filter(x=>x.r===max).sort((a,b)=>a.t-b.t); + const l=best.length; + const med=((best[(l-1)>>1].t+best[l>>1].t)/2).toFixed(2); + const avg=(best.reduce((a,c)=>a+c.t,0)/l).toFixed(2); + const statDiv=document.createElement('div'); statDiv.className='mt-8 p-6 bg-white rounded-2xl border border-gray-200 shadow-sm text-center'; - statDiv.innerHTML=`

Optimal Temperature

${optimal}
Avg of Peak Performance (${(max*100).toFixed(0)}%)
`; + statDiv.innerHTML=` +

Optimal Temperature (Peak ${(max*100).toFixed(0)}%)

+
+
+
${med}
+
Median
+
+
+
${avg}
+
Average
+
+
`; container.appendChild(statDiv); } })();