Exemplo n.º 1
0
        private static long TestSqlCacheWrite(int length)
        {
            var client = new SqlMemoryCacheClient("cache");

            var sw = Stopwatch.StartNew();

            for (int i = 0; i < length; i++)
            {
                client.Store("asdfasdf" + i.ToString(), stringToTest);
            }

            sw.Stop();
            return sw.ElapsedMilliseconds;
        }
Exemplo n.º 2
0
        private static long TestSqlCacheRead(int length)
        {
            var client = new SqlMemoryCacheClient("cache");

            var sw = Stopwatch.StartNew();

            for (int i = 0; i < length; i++)
            {
                var result = client.ExecuteGet("asdfasdf" + i.ToString());
                if (result != stringToTest) throw new Exception();
            }

            sw.Stop();
            return sw.ElapsedMilliseconds;
        }