Skip to main content
Version: 2.14.1

Humanizer.Bytes.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

Constructors​

ByteRate(ByteSize, TimeSpan) Constructor​

Create a ByteRate with given quantity of bytes across an interval

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

Parameters​

size ByteSize

interval System.TimeSpan

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.Bytes.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.Localisation.TimeUnit timeUnit=Humanizer.Localisation.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.Localisation.TimeUnit timeUnit=Humanizer.Localisation.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