Ejemplo n.º 1
0
    void ReadProtobuf()
    {
        RequestWithSimpleOneof msg = new RequestWithSimpleOneof();
        FCSerialize            ar  = new FCSerialize();

        ar.ReadMode(m_msgBuffer);
        msg.ReadFrom(ar);
        PrintMsg(msg);
    }
Ejemplo n.º 2
0
    public uint  NormalReadProto()
    {
        uint nBeginTime = os.GetTickCount();

        for (int i = 0; i < 100000; ++i)
        {
            Person msg = new Person();

            FCSerialize ar = new FCSerialize();
            ar.ReadMode(Buffer, 0, BufferLen);
            msg.ReadFrom(ar);
        }
        uint nEndTime = os.GetTickCount();

        os.print("normal read proto, cost time:{0}ms, BufferLen = {1}", (nEndTime - nBeginTime), BufferLen);
        return(nEndTime - nBeginTime);
    }