示例#1
0
        static void Main(string[] args)
        {
            HyperTimer
            .Configure()
            .UseTimerServicesProvider(new DefaultTimerServicesProvider());


            Console.WriteLine("Running hypertimer with an interval of 1 sec for over 15 cycles");
            Console.WriteLine("Then waits 5 sec(while timer keep running), throttles 3 sec,");
            Console.WriteLine("displays some info, and continues until end.\n");

            var timer = HyperTimer.StartNew(1000, timer_Elapsed, timer_Stopped)
                        .StopIn(15)
                        .Wait(5000);

            timer.Throttle(3000);

            //timer.Delay(1000);
            Console.WriteLine(" Progress Until last Cycle: {0}", timer.TotalElapsedUntilLastCycle);
            Console.WriteLine(" Total Elapsed Progress: {0}", timer.TotalElapsed);
            Console.ReadLine();


            Console.WriteLine("Total: {0}", _total);
            timer.Dispose();
        }
示例#2
0
 private void Configure()
 {
     HyperTimer.Configure()
     .UseTimerServicesProvider(new DefaultTimerServicesProvider());
 }