Ejemplo n.º 1
0
 private static void RunOneFrameOfProfiling(CodeProfiler profiler)
 {
     profiler.BeginFrame();
     profiler.Start(ProfilingMode.Rendering, Section);
     profiler.Stop(ProfilingMode.Rendering, Section);
     profiler.EndFrame();
 }
Ejemplo n.º 2
0
        public void DoesNotResetIfTooShortATimeHasPassed()
        {
            var profiler = new CodeProfiler(1, 1);

            Thread.Sleep(2);
            profiler.BeginFrame();
            Assert.AreEqual(0.0f, profiler.lastResetTime);
        }
Ejemplo n.º 3
0
        public void ResetsIfEnoughTimeHasPassed()
        {
            var profiler = new CodeProfiler(1, 0.0001f);

            Thread.Sleep(2);
            RunOneFrameOfProfiling(profiler);
            profiler.BeginFrame();
            Assert.IsTrue(profiler.lastResetTime > 0.0f);
        }
Ejemplo n.º 4
0
        public void ProfilingWhenInactiveDoesNothing()
        {
            var profiler = new CodeProfiler {
                IsActive = false
            };

            profiler.BeginFrame();
            profiler.Start(ProfilingMode.Rendering, Section);
            profiler.Stop(ProfilingMode.Rendering, Section);
            profiler.EndFrame();
            Assert.AreEqual(0, profiler.Sections[(int)ProfilingMode.Rendering].Count);
        }
Ejemplo n.º 5
0
		private static void RunOneFrameOfProfiling(CodeProfiler profiler)
		{
			profiler.BeginFrame();
			profiler.Start(ProfilingMode.Rendering, Section);
			profiler.Stop(ProfilingMode.Rendering, Section);
			profiler.EndFrame();
		}
Ejemplo n.º 6
0
		public void ProfilingWhenInactiveDoesNothing()
		{
			var profiler = new CodeProfiler { IsActive = false };
			profiler.BeginFrame();
			profiler.Start(ProfilingMode.Rendering, Section);
			profiler.Stop(ProfilingMode.Rendering, Section);
			profiler.EndFrame();
			Assert.AreEqual(0, profiler.Sections[(int)ProfilingMode.Rendering].Count);
		}
Ejemplo n.º 7
0
		public void ResetsIfEnoughTimeHasPassed()
		{
			var profiler = new CodeProfiler(1, 0.0001f);
			Thread.Sleep(2);
			RunOneFrameOfProfiling(profiler);
			profiler.BeginFrame();
			Assert.IsTrue(profiler.lastResetTime > 0.0f);
		}
Ejemplo n.º 8
0
		public void DoesNotResetIfTooShortATimeHasPassed()
		{
			var profiler = new CodeProfiler(1, 1);
			Thread.Sleep(2);
			profiler.BeginFrame();
			Assert.AreEqual(0.0f, profiler.lastResetTime);
		}