Files
pip/main.cpp
2020-07-30 20:08:33 +03:00

64 lines
1.4 KiB
C++

#include "pip.h"
/*#ifdef PIP_LUA
#include "piluaprogram.h"
static const char * script
= "-- script.lua \n"
"test()\n"
"testString = \"LuaBridge works ававава!\" \n"
"number = 42 \n";
void test() {
piCout << "C function test";
}
int main() {
PILuaProgram p;
p.getGlobalNamespace().addFunction("test", test);
if (!p.load(PIString::fromUTF8(script))) piCout << "error";
p.prepare();
luabridge::LuaRef s = p.getGlobal("testString");
luabridge::LuaRef n = p.getGlobal("number");
PIString luaString = s.cast<PIString>();
int answer = n.cast<int>();
piCout << luaString;
piCout << "And here's our number:" << answer;
}
#else
int main() {
return 0;
}
#endif
*/
#include "picodeparser.h"
int main() {
//piDebug = false;
double min = -1, max = -1, mean = 0;
for (int i = 0; i < 1; ++i) {
PITimeMeasurer tm;
/*PICodeParser cp;
cp.parseFile("SH_plugin_base.h");*/
PIStringList sl;
sl.reserve(10);
for (int i = 0; i < 10; ++i) {
//PIString s = PIString("1234567890-=").repeated(100);
//sl.push_back(PIString("1234567890-=").repeated(100));
sl << PIString("abc").repeated(i + 1);
}
for (PIString & s : sl) {
s = s.toUpperCase();
piCout << s;
}
double ms = tm.elapsed_m();
if (min < 0) min = ms;
if (max < 0) max = ms;
min = piMin(min, ms);
max = piMax(max, ms);
mean += ms;
}
piDebug = true;
piCout << min << (mean / 50) << max;
}