Tick() private method

private Tick ( ) : void
return void
示例#1
0
        public static MeterMetric New(string eventType, TimeUnit rateUnit)
        {
            var meter = new MeterMetric(eventType, rateUnit);

            Task.Factory.StartNew(async() =>
            {
                while (!meter._token.IsCancellationRequested)
                {
                    await Task.Delay(Interval, meter._token.Token);
                    meter.Tick();
                }
            }, meter._token.Token);
            return(meter);
        }
示例#2
0
        public static MeterMetric New(string eventType, TimeUnit rateUnit)
        {
            var meter = new MeterMetric(eventType, rateUnit);

            Task.Factory.StartNew(() =>
            {
                while (!meter._token.IsCancellationRequested)
                {
                    Thread.Sleep(Interval);
                    meter.Tick();
                }
            }, meter._token.Token);

            return meter;
        }
示例#3
0
        public static MeterMetric New(string eventType, TimeUnit rateUnit)
        {
            var meter = new MeterMetric(eventType, rateUnit);

            meter._tickThread = _factory.New(
                ()=>
                    {
                        new Timer(s => meter.Tick(), null, _interval, _interval);
                    }
                );

            meter._tickThread.Start();

            return meter;
        }
示例#4
0
        public static MeterMetric New(string eventType, TimeUnit rateUnit)
        {
            var meter = new MeterMetric(eventType, rateUnit);

            meter._token = Utils.StartCancellableTask(() =>
            {
                while (!meter._token.IsCancellationRequested)
                {
                    Thread.Sleep(Interval);
                    meter.Tick();
                }
            });

            return meter;
        }