Subversion Repositories group.electronics

Rev

Rev 161 | 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 timer = ((Timer)sender);
            timer.Enabled = false;
        }

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

        public struct InputPair {
            public UInt64 prev;
            public UInt64 curr;
        }
    }

}