Несоответствие данных Hive Bucket Join (SMB) при объединении таблиц с таблицами секционирования и таблицами

Вместо циклирования вы можете использовать таймер для периодического опроса для использования ЦП.

class Test
{
    private System.Timers.Timer _timer;

    public Test( )
    {
        _timer = new System.Timers.Timer
        {
            // Interval set to 1 millisecond.
            Interval = 1,
            AutoReset = true,                
        };
        _timer.Elapsed += _timer_Elapsed;
        _timer.Enabled = true;
        _timer.Start( );
    }

    private void _timer_Elapsed( object sender, System.Timers.ElapsedEventArgs e )
    {
        // This handler is not executed on the gui thread so
        // you'll have to marshal the call to the gui thread
        // and then update your property.
       var grabber = new CpuInfoGrabber();
       var data = grabber.CpuPerUsed();
       Application.Current.Dispatcher.Invoke( ( ) => Bnd.PerCpu = data );
    }
}
0
задан Klaus Gütter 19 January 2019 в 07:03
поделиться