ultimatepp/benchmarks/StringSet0/StringSet0.cpp
cxl 7fdcd021bf .benchmarks
git-svn-id: svn://ultimatepp.org/upp/trunk@14602 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-06-16 21:47:23 +00:00

25 lines
403 B
C++

#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];
}
}