TicksAlignToSubsecondDistribution Method

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

Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static Ticks AlignToSubsecondDistribution(
	Ticks timestamp,
	int samplesPerSecond,
	long timeResolution
)

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