Пример #1
0
        public bool GetSingleColumnSlow(Stopwatch watch, int repeatCount, int takeCount)
        {
            watch.Start();

            for (var i = 0; i < repeatCount; i++)
            {
                using (var db = new L2DBContext(TrackChanges))
                    db.Execute <int>(GetSingleColumnSql);
            }

            watch.Stop();

            return(true);
        }
Пример #2
0
        public bool GetSingleColumnParam(Stopwatch watch, int repeatCount, int takeCount)
        {
            watch.Start();

            using (var db = new L2DBContext(TrackChanges))
                for (var i = 0; i < repeatCount; i++)
                {
                    db.Execute <int>(GetParamSql,
                                     new DataParameter("@id", 1),
                                     new DataParameter("@p", 2));
                }

            watch.Stop();

            return(true);
        }