Subversion Repositories group.electronics

Rev

Rev 161 | Go to most recent revision | Details | 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) {
11
            ((Timer)sender).Enabled = false;
12
            //delay.Enabled = false;
13
        }
14
 
15
        public static void delayms(double ms = 100) {
16
            Timer delay = new Timer();
17
            delay.AutoReset = false;
18
            delay.Elapsed += Utils.delay_Elapsed;
19
            delay.Interval = ms;
20
            delay.Enabled = true;
21
            uint dummy = 0;
22
            while (delay.Enabled) { dummy++; }
23
        }
24
    }
25
 
26
}