Subversion Repositories group.electronics

Rev

Rev 160 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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