Exemplo n.º 1
0
 public ClassOneCommon(string name)
 {
     this.Name  = name;
     this.Name2 = name;
     this.Name3 = name;
     this.One   = new ClassOneCommon();
 }
Exemplo n.º 2
0
        public void Speed()
        {
            const int max  = 1000000;
            var       obj0 = new ClassOne("哈哈");
            Stopwatch s    = new Stopwatch();

            s.Restart();
            for (var i = 0; i < max; i++)
            {
                var code = obj0.GetHashCode();
            }
            var elapsed0 = s.ElapsedMilliseconds;

            var obj1 = new ClassOneCommon("哈哈");

            s.Restart();
            for (var i = 0; i < max; i++)
            {
                var code = obj1.GetHashCode();
            }
            var elapsed1 = s.ElapsedMilliseconds;
        }