ProfilerValueUnit

Description

struct Tinman.Engine.Profiling.ProfilerValueUnit

Represents a profiler value unit.

Public / Constants

Bytes


public static readonly attribute Bytes → (ProfilerValueUnit)

Memory amount in bytes.

Hertz


public static readonly attribute Hertz → (ProfilerValueUnit)

Frequency in Hertz.

These are the nicely matching pairs of milli-seconds and Hertz values that result in unity:

   1 Hz ~= 1000 ms
   2 Hz ~=  500 ms
   4 Hz ~=  250 ms
   5 Hz ~=  200 ms
   8 Hz ~=  125 ms
  10 Hz ~=  100 ms
  20 Hz ~=   50 ms
  25 Hz ~=   40 ms
  40 Hz ~=   25 ms
  50 Hz ~=   20 ms
 100 Hz ~=   10 ms
 125 Hz ~=    8 ms
 200 Hz ~=    5 ms
 250 Hz ~=    4 ms
 500 Hz ~=    2 ms
1000 Hz ~=    1 ms

KiloBytes


public static readonly attribute KiloBytes → (ProfilerValueUnit)

Memory amount in kilo-bytes (2^20).

MegaBytes


public static readonly attribute MegaBytes → (ProfilerValueUnit)

Memory amount in mega-bytes (2^20).

MicroSeconds


public static readonly attribute MicroSeconds → (ProfilerValueUnit)

Time span in micro-seconds (10^-6).

MilliSeconds


public static readonly attribute MilliSeconds → (ProfilerValueUnit)

Time span in milli-seconds (10^-3).

NanoSeconds


public static readonly attribute NanoSeconds → (ProfilerValueUnit)

Time span in nano-seconds (10^-9).

Percent


public static readonly attribute Percent → (ProfilerValueUnit)

A unit-less value measured in percent.

Seconds


public static readonly attribute Seconds → (ProfilerValueUnit)

Time span in seconds.

Unity


public static readonly attribute Unity → (ProfilerValueUnit)

Unity with scale of one.

Unknown


public static readonly attribute Unknown → (ProfilerValueUnit)

The unknown unit.

Public / Constructors

ProfilerValueUnit


public constructor ProfilerValueUnit → (4)

name in : string

[not-null]
Human-readable name of the value unit.

baseTypeNumerator in : char

Unique identifier of the base unit in the numerator.

baseTypeDenominator in : char

Unique identifier of the base unit in the denominator.

baseScale in : float64

[>0]
The scale of this unit, expressed in the base unit.

Creates a new instance of ProfilerValueUnit.

Public / Methods

Compatible


public method Compatible → (1)

other in : ProfilerValueUnit

The other unit.

returns → bool

true if both units are compatible, false if not.

Is this unit compatible with the given one?

Convert


[Pure]
public method Convert → (2)

value in : float64

The value, in this unit.

target in : ProfilerValueUnit

The target unit.

returns → float64

The value, in target in units. Will be Maths.NanD iff target in is incompatible.

Converts the given value from this unit to the given target in unit.

Per


[Pure]
public method Per → (1)

other in : ProfilerValueUnit

The other unit.

returns → ProfilerValueUnit

The unit that represents the quotient of this / other in.

Returns a ProfilerValueUnit that represents the quotient of this unit and the given one.

ToString


public override method ToString → ()

returns → string

The unit name.

Returns the human-readable name of this profiler value unit.

Public / Attributes

IsUnity


public attribute IsUnity → (get)

value : bool

true if this is unity, false if not.

Is this unity?

IsUnknown


public attribute IsUnknown → (get)

value : bool

true if this is the unknown unit, false if not.

Is this the unknown unit?