66 lines
1.4 KiB
C++
66 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
|
|
*/
|
|
class db {
|
|
public:
|
|
db() {
|
|
for (int i=0; i<10000; ++i)
|
|
x << sin(double(i)/180.0);
|
|
//printf("jkfkhg\n");
|
|
}
|
|
private:
|
|
PIVector<double> x;
|
|
};
|
|
|
|
#include "picodeparser.h"
|
|
int main() {
|
|
/*PIString s(" 324 654 sf 5fdwg sdfsdf sdfefg");
|
|
piCout << s;
|
|
piCout << s.replaceAll(' ', '1');*/
|
|
piDebug = false;
|
|
double min = -1, max = -1, mean = 0;
|
|
for (int i = 0; i < 50; ++i) {
|
|
PICodeParser cp;
|
|
PITimeMeasurer tm;
|
|
cp.parseFile("SH_plugin_base.h");
|
|
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;
|
|
}
|