BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
BioImager.DTimer Class Reference

Public Member Functions

bool Initialize ()
 
void Frame2 ()
 

Properties

float FrameTime [get]
 
float CumulativeFrameTime [get]
 

Detailed Description

Definition at line 5 of file DTimer.cs.

Member Function Documentation

◆ Frame2()

void BioImager.DTimer.Frame2 ( )

Definition at line 31 of file DTimer.cs.

32 {
33 // Query the current time.
34 long currentTime = _StopWatch.ElapsedTicks;
35
36 // Calculate the difference in time since the last time we queried for the current time.
37 float timeDifference = currentTime - m_LastFrameTime;
38
39 // Calculate the frame time by the time difference over the timer speed resolution.
40 FrameTime = timeDifference / m_ticksPerMs;
41 CumulativeFrameTime += FrameTime;
42
43 // record this Frames durations to the LastFrame for next frame processing.
44 m_LastFrameTime = currentTime;
45 }

◆ Initialize()

bool BioImager.DTimer.Initialize ( )

Definition at line 17 of file DTimer.cs.

18 {
19 // Check to see if this system supports high performance timers.
20 if (!Stopwatch.IsHighResolution)
21 return false;
22 if (Stopwatch.Frequency == 0)
23 return false;
24
25 // Find out how many times the frequency counter ticks every millisecond.
26 m_ticksPerMs = (float)(Stopwatch.Frequency / 1000.0f);
27
28 _StopWatch = Stopwatch.StartNew();
29 return true;
30 }

Property Documentation

◆ CumulativeFrameTime

float BioImager.DTimer.CumulativeFrameTime
get

Definition at line 14 of file DTimer.cs.

14{ get; private set; }

◆ FrameTime

float BioImager.DTimer.FrameTime
get

Definition at line 13 of file DTimer.cs.

13{ get; private set; }

The documentation for this class was generated from the following file: