Skip to content

Commit

Permalink
add benchmark update random
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Jan 26, 2024
1 parent fff1750 commit c3b6ac7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions controller/src/techempower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,16 @@ std::string techempowerupdates(std::shared_ptr<httppeer> peer)
if (myworld.effect() > 0)
{
unsigned int j = myworld.record.size() - 1;
myworld.data.randomnumber = rand_range(1, 10000);
myworld.record[j].randomnumber = myworld.data.randomnumber;
myworld.update("randomnumber");
myworld.record[j].randomnumber = rand_range(1, 10000);
//myworld.update("randomnumber");
}
}
for (unsigned int i = 0; i < myworld.record.size(); i++)
{
myworld.wheresql.clear();
myworld.data.randomnumber = myworld.record[i].randomnumber;
myworld.where("id", myworld.record[i].id).update("randomnumber");
}
peer->output = myworld.to_json();
return "";
}
Expand Down

0 comments on commit c3b6ac7

Please sign in to comment.