Exemple #1
0
    public override T Deserialize <T>(string text)
    {
        var s = Environment.TickCount;
        var r = JsonUtility.FromJson <T>(text);

        DeserializeTimeList.Add(Environment.TickCount - s);
        return(r);
    }
Exemple #2
0
    public override T Deserialize <T>(string text)
    {
        var r   = new JsonFx.Json.JsonReader();
        var s   = Environment.TickCount;
        var ret = r.Read <T>(text);

        DeserializeTimeList.Add(Environment.TickCount - s);
        return(ret);
    }
Exemple #3
0
    public override T Deserialize <T>(string text)
    {
        var xmlSerializer = new XmlSerializer(typeof(T));

        using (var r = new StringReader(text))
        {
            var s   = Environment.TickCount;
            var ret = (T)xmlSerializer.Deserialize(r);
            DeserializeTimeList.Add(Environment.TickCount - s);
            return(ret);
        }
    }
Exemple #4
0
    public override T Deserialize <T>(string text)
    {
        Deserializer deserializer = new Deserializer();

        using (var r = new StringReader(text))
        {
            var s   = Environment.TickCount;
            T   ret = deserializer.Deserialize <T>(r);
            DeserializeTimeList.Add(Environment.TickCount - s);
            return(ret);
        }
    }