Пример #1
0
        public TSerialized GenerateSampleSerializedData(bool useEncryption)
        {
            var generatedObject = GenerateSampleObject(useEncryption);

            GeneratedKeyring.Lock();
            var serializedData = ProfiledSerializationFunction.Invoke(generatedObject);

            GeneratedKeyring.Unlock();
            return(serializedData);
        }
Пример #2
0
        public List <TimeSpan> ProfileSerializationWorkflow(bool useEncryption, int runs = 1)
        {
            var times      = new List <TimeSpan>();
            var sw         = new Stopwatch();
            var testObject = GenerateSampleObject(useEncryption);

            GeneratedKeyring.Lock();
            for (int i = 0; i < runs; i++)
            {
                sw.Restart();
                ProfiledSerializationFunction.Invoke(testObject);
                sw.Stop();
                times.Add(sw.Elapsed);
            }
            GeneratedKeyring.Unlock();
            return(times);
        }