ultimatepp/reference/Timing/main.cpp
cxl b9906397bd .reference
git-svn-id: svn://ultimatepp.org/upp/trunk@7605 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2014-08-26 07:24:21 +00:00

28 lines
394 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
Index<String> index;
TimeStop tm;
RTIMESTOP("Total runtime");
for(int i = 0; i < 1000000; i++) {
int x;
String q;
{
RTIMING("rand");
x = rand();
}
{
RTIMING("AsString");
q = AsString(x);
}
{
RTIMING("Index::FindAdd");
index.FindAdd(q);
}
}
RDUMP(index.GetCount());
RDUMP(tm.Elapsed());
}