mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-30 14:22:28 -06:00
.benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@14602 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f3ad311cf9
commit
7fdcd021bf
3 changed files with 36 additions and 0 deletions
25
benchmarks/StringSet0/StringSet0.cpp
Normal file
25
benchmarks/StringSet0/StringSet0.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
String RandomString(int len)
|
||||
{
|
||||
String h;
|
||||
while(len-- > 0)
|
||||
h.Cat(Random(96) + 32);
|
||||
return h;
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Buffer<String> s(10000), t(10000);
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
s[i] = RandomString(Random(20));
|
||||
|
||||
RTIMING("Set0");
|
||||
for(int j = 0; j < 10000; j++) {
|
||||
for(int i = 0; i < 10000; i++)
|
||||
t[i] = ~s[i];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue