Table of Contents

Struct Hours

Namespace
SampSharp.OpenMp.Core.Std.Chrono
Assembly
SampSharp.OpenMp.Core.dll

Represents a duration in hours which is represented in memory like an std::chrono::hours from the C++ standard library. MSVC uses duration<int, ratio<3600>>, so the layout is a single 32-bit int.

public readonly struct Hours
Inherited Members

Constructors

Hours(int)

Initializes a new instance of the Hours struct.

public Hours(int value)

Parameters

value int

The duration value in hours.

Methods

AsTimeSpan()

Converts this duration to a TimeSpan.

public TimeSpan AsTimeSpan()

Returns

TimeSpan

The duration as a TimeSpan.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator TimeSpan(Hours)

Converts an Hours value to a TimeSpan.

public static implicit operator TimeSpan(Hours hours)

Parameters

hours Hours

The value to convert.

Returns

TimeSpan

implicit operator Hours(TimeSpan)

Converts a TimeSpan to an Hours value.

public static implicit operator Hours(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The time span to convert.

Returns

Hours