private void timer1_Tick(object sender, EventArgs e) { if (ExecEnabled) { double sumMS = 0; double ms = 0; FramesCounter += FramesPerTick; while (FramesCounter > 0) { FramesCounter -= 1; DateTime d0 = DateTime.Now; myC64.ProcessFrames(1); TimeSpan dur = DateTime.Now - d0; ms = dur.TotalMilliseconds; sumMS += ms; } } timer1.Interval = 16; this.pictureBox1.Invalidate(); }