Skip to content

Commit

Permalink
calculate score by cores
Browse files Browse the repository at this point in the history
  • Loading branch information
alvindimas05 committed Aug 10, 2024
1 parent 544efe2 commit 9320471
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ public void run() {
cs.sendMessage("");
cs.sendMessage("§2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l BENCHMARK RESULTS §2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
cs.sendMessage("");
cs.sendMessage(" §2✸ §fCPU Name: §e" + cpuname);
cs.sendMessage(" §2✸ §fCPU Name: §e" + cpuname);
cs.sendMessage(" §2✸ §fTotal Cores: §e" + br.getCores());
cs.sendMessage(" §2✸ §fAvailable Cores: §e" + cores);
cs.sendMessage("");
if (br.getOk()) {
cs.sendMessage(" §2✸ §fCPU Score: §e" + br.getStringifiedSth());
cs.sendMessage(" §2✸ §fThread Score: §e" + br.getStringifiedTh());
cs.sendMessage(" §2✸ §fCPU Score: §e" + br.getStringifiedSth(true));
cs.sendMessage(" §2✸ §fThread Score: §e" + br.getStringifiedTh(true));
} else {
// cs.sendMessage(" §eBenchmark feature coming soon!");
cs.sendMessage(" §cThere was an error getting the full benchmark results.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public BenchResponse(int singlethread, int multithread, int thread, int cores, b
this.thread = thread;
this.cores = cores;
this.ok = ok;


}

public boolean getOk() {
Expand All @@ -36,10 +38,17 @@ public int getCores(){
return cores;
}

public String getStringifiedSth() {
public String getStringifiedSth(boolean calculateByCores) {
if (singlethread < 0) {
return "Unknown Score";
}

if(calculateByCores){
return String.valueOf(
(int) (((double) SpecsGetter.getCores() / cores) * singlethread)
);
}

return String.valueOf(singlethread);
}

Expand All @@ -50,10 +59,18 @@ public String getStringifiedMth() {
return String.valueOf(multithread);
}

public String getStringifiedTh() {
public String getStringifiedTh(boolean calculateByCores) {
if (thread < 0) {
return "Unknown Score";
}


if(calculateByCores){
return String.valueOf(
(int) (((double) SpecsGetter.getCores() / cores) * thread)
);
}

return String.valueOf(thread);
}

Expand Down

0 comments on commit 9320471

Please sign in to comment.