C# Class SharpOS.Kernel.Foundation.Clock

Datei anzeigen Open project: sharpos/SharpOS

Public Properties

Property Type Description
HardwareSyncTicks int

Public Methods

Method Description
GetBootTime ( Time time ) : void

Retrieves the system boot time.

GetCurrentTime ( ) : Time
GetCurrentTime ( Time time ) : void

Retrieves the current system clock time.

GetCurrentTimestamp ( ) : ulong
GetHardwareTime ( Time time ) : bool

Retrieves the current hardware time. If this is not possible, this method returns false.

GetHardwareTimestamp ( ) : ulong

Retrieves the current hardware time as a timestamp. If this is not possible, this method returns 0.

GetNanostamp ( ) : ulong

Returns the amount of nanoseconds since the last ResetNanostamp() call. This value is limited in precision to the frequency of the system timer.

ResetNanostamp ( ) : void

Resets the nanostamp counter.

Setup ( ) : void

Initializes the system clock. First the hardware time is read and stored as the boot time and current time. The times are stored as 64-bit unsigned integers with 100-nanosecond ticks since the epoch (January 1, 0001, 00:00:00). A handler is added to the system timer event which updates the current time and handles periodic synchronization with the hardware time. The amount added to the current time per timer fire is relevant to the frequency reportedly used by the system timer.

Write ( ) : void

Private Methods

Method Description
UpdateClock ( uint ticks ) : void

Method Details

GetBootTime() public static method

Retrieves the system boot time.
public static GetBootTime ( Time time ) : void
time Time
return void

GetCurrentTime() public static method

public static GetCurrentTime ( ) : Time
return Time

GetCurrentTime() public static method

Retrieves the current system clock time.
public static GetCurrentTime ( Time time ) : void
time Time
return void

GetCurrentTimestamp() public static method

public static GetCurrentTimestamp ( ) : ulong
return ulong

GetHardwareTime() public static method

Retrieves the current hardware time. If this is not possible, this method returns false.
public static GetHardwareTime ( Time time ) : bool
time Time
return bool

GetHardwareTimestamp() public static method

Retrieves the current hardware time as a timestamp. If this is not possible, this method returns 0.
public static GetHardwareTimestamp ( ) : ulong
return ulong

GetNanostamp() public static method

Returns the amount of nanoseconds since the last ResetNanostamp() call. This value is limited in precision to the frequency of the system timer.
public static GetNanostamp ( ) : ulong
return ulong

ResetNanostamp() public static method

Resets the nanostamp counter.
public static ResetNanostamp ( ) : void
return void

Setup() public static method

Initializes the system clock. First the hardware time is read and stored as the boot time and current time. The times are stored as 64-bit unsigned integers with 100-nanosecond ticks since the epoch (January 1, 0001, 00:00:00). A handler is added to the system timer event which updates the current time and handles periodic synchronization with the hardware time. The amount added to the current time per timer fire is relevant to the frequency reportedly used by the system timer.
public static Setup ( ) : void
return void

Write() public static method

public static Write ( ) : void
return void

Property Details

HardwareSyncTicks public_oe static_oe property

The interval of time (in 100-nanosecond ticks) between synchronizations from the hardware clock to the software clock. (default 600000000 ticks is 1 minute).
public static int HardwareSyncTicks
return int