示例#1
0
        private static double ExecuteLuaIntfCompiled(string sScript, int iLoops)
        {
            using (LuaInterface.Lua lua = new LuaInterface.Lua())
            {
                lua.RegisterFunction("test", null, typeof(Program).GetMethod("LuaTest"));
                lua.RegisterFunction("echo", null, typeof(Program).GetMethod("LuaEcho"));
                LuaInterface.LuaFunction f = lua.LoadString(sScript, "test");

                Stopwatch sw = new Stopwatch();
                sw.Start();

                for (int i = 0; i < iLoops; i++)
                {
                    DebugOut("LuaIntf-C", i, f.Call());
                }

                return(sw.ElapsedMilliseconds / (double)iLoops);
            }
        }
示例#2
0
文件: Program.cs 项目: edisonh/neolua
    private static double ExecuteLuaIntfCompiled(string sScript, int iLoops)
    {
      using (LuaInterface.Lua lua = new LuaInterface.Lua())
      {
        lua.RegisterFunction("test", null, typeof(Program).GetMethod("LuaTest"));
        lua.RegisterFunction("echo", null, typeof(Program).GetMethod("LuaEcho"));
        LuaInterface.LuaFunction f = lua.LoadString(sScript, "test");
        
        Stopwatch sw = new Stopwatch();
        sw.Start();

        for (int i = 0; i < iLoops; i++)
          DebugOut("LuaIntf-C", i, f.Call());

        return sw.ElapsedMilliseconds / (double)iLoops;
      }
    }