withSIX.Play.Core.Games.Legacy.ServerQuery.ServerQueryState.StopSW C# (CSharp) Method

StopSW() public method

public StopSW ( ) : void
return void
        public virtual void StopSW() {
            _stopWatch.Stop();
            if (_stopWatch.ElapsedMilliseconds > 0)
                Pings.Add(_stopWatch.ElapsedMilliseconds);
            _stopWatch.Reset();
        }

Usage Example

        async Task FetchAsync()
        {
            try {
                await ProcessAllPackets().ConfigureAwait(false);

                _state.ProcessParser(_parser);
                if (_state.Success)
                {
                    _state.Server.UpdateInfoFromResult(_state.Result);
                }
            } catch (TimeoutException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (ObjectDisposedException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (Exception e) {
                _state.Exception = e;
                _state.Cancel();
                throw;
            } finally {
                _state.StopSW();
            }
        }
All Usage Examples Of withSIX.Play.Core.Games.Legacy.ServerQuery.ServerQueryState::StopSW