Subversion Repositories group.electronics

Rev

Rev 161 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;

namespace nitdcscore {
    public class Utils {
        private static void delay_Elapsed(object sender, ElapsedEventArgs e) {
            ((Timer)sender).Enabled = false;
            //delay.Enabled = false;
        }

        public static void delayms(double ms = 100) {
            Timer delay = new Timer();
            delay.AutoReset = false;
            delay.Elapsed += Utils.delay_Elapsed;
            delay.Interval = ms;
            delay.Enabled = true;
            uint dummy = 0;
            while (delay.Enabled) { dummy++; }
        }
    }

}