Click or drag to resize

TicksAlignToSubsecondDistribution Method

Returns a floor-aligned sub-second distribution timestamp for given timestamp.

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public static Ticks AlignToSubsecondDistribution(
	Ticks timestamp,
	int samplesPerSecond,
	long timeResolution
)
View Source

Parameters

timestamp  Ticks
Timestamp to align.
samplesPerSecond  Int32
Samples per second to use for distribution.
timeResolution  Int64
Defines the time resolution to use when aligning timestamp to its proper distribution timestamp.

Return Value

Ticks
A floor-aligned sub-second distribution timestamp for given timestamp.
Remarks
Time resolution value is typically a power of 10 based on the number of ticks per the desired resolution. The following table defines common resolutions and their respective timeResolution values:
ResolutionTime Resolution Value
SecondsPerSecond
MillisecondsPerMillisecond
MicrosecondsPerMicrosecond
Ticks0
If source timestamps have variation, i.e., they are not aligned within common distributions, the timeResolution can be adjusted to include slack to accommodate the variance. When including slack in the time resolution, the value will depend on the samplesPerSecond, for example: you could use 330,000 for 30 samples per second, 160,000 for 60 samples per second, and 80,000 for 120 samples per second. Actual slack value may need to be more or less depending on the size of the source timestamp variation.
See Also