コード例 #1
0
ファイル: Program.cs プロジェクト: nmaier/PersistantCache
        private static void RunPersistanceCacheTest(List <List <CacheItem> > data)
        {
            Console.WriteLine("Starting {0} threads", data.Count);
            var thread  = 0;
            var threads = new List <Task>(data.Count);

            foreach (var set in data)
            {
                threads.Add(Task.Factory.StartNew(() => RunThreadPersistancCacheTest(set, thread++)));
            }

            Console.WriteLine("Executing");
            Console.WriteLine("");

            Task.WaitAll(threads.ToArray());

            Console.WriteLine("cleaning up...");

            var sw = new Stopwatch();

            sw.Start();
            PersistentCache.Dispose();
            sw.Stop();

            Console.WriteLine("clean in {0}ms :D", sw.ElapsedMilliseconds);
        }
コード例 #2
0
 private void CacheTest_FormClosed(object sender, FormClosedEventArgs e)
 {
     store.Dispose();
 }