Skip to main content
Version: 3.0.8

Humanizer.ByteRate

ByteRate Class

Class to hold a ByteSize and a measurement interval, for the purpose of calculating the rate of transfer

public class ByteRate

Inheritance System.Object → ByteRate

Remarks

Create a ByteRate with given quantity of bytes across an interval

Constructors

ByteRate(ByteSize, TimeSpan) Constructor

Class to hold a ByteSize and a measurement interval, for the purpose of calculating the rate of transfer

public ByteRate(Humanizer.ByteSize size, System.TimeSpan interval);

Parameters

size ByteSize

interval System.TimeSpan

Remarks

Create a ByteRate with given quantity of bytes across an interval

Properties

ByteRate.Interval Property

Interval that bytes were transferred in

public System.TimeSpan Interval { get; }

Property Value

System.TimeSpan

ByteRate.Size Property

Quantity of bytes

public Humanizer.ByteSize Size { get; }

Property Value

ByteSize

Methods

ByteRate.Humanize(TimeUnit) Method

Calculate rate for the quantity of bytes and interval defined by this instance

public string Humanize(Humanizer.TimeUnit timeUnit=Humanizer.TimeUnit.Second);

Parameters

timeUnit TimeUnit

Unit of time to calculate rate for (defaults is per second)

Returns

System.String

ByteRate.Humanize(string, TimeUnit, CultureInfo) Method

Calculate rate for the quantity of bytes and interval defined by this instance

public string Humanize(string? format, Humanizer.TimeUnit timeUnit=Humanizer.TimeUnit.Second, System.Globalization.CultureInfo? culture=null);

Parameters

format System.String

The string format to use for the number of bytes

timeUnit TimeUnit

Unit of time to calculate rate for (defaults is per second)

culture System.Globalization.CultureInfo

Culture to use. If null, current thread's UI culture is used.

Returns

System.String