Subversion Repositories group.electronics

Rev

Rev 161 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
160 pfowler 1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Timers;
7
 
8
namespace nitdcscore {
9
    public class Utils {
10
        private static void delay_Elapsed(object sender, ElapsedEventArgs e) {
161 pfowler 11
            Timer timer = ((Timer)sender);
12
            timer.Enabled = false;
160 pfowler 13
        }
14
 
15
        public static void delayms(double ms = 100) {
16
            Timer delay = new Timer();
17
            delay.AutoReset = false;
161 pfowler 18
            delay.Interval = ms;
160 pfowler 19
            delay.Elapsed += Utils.delay_Elapsed;
20
            delay.Enabled = true;
21
            uint dummy = 0;
22
            while (delay.Enabled) { dummy++; }
23
        }
161 pfowler 24
 
25
        public struct InputPair {
166 pfowler 26
            public UInt64 prev;
27
            public UInt64 curr;
161 pfowler 28
        }
160 pfowler 29
    }
30
 
31
}