using System; namespace Unosquare.RaspberryIO.Abstractions { /// /// Interface for timing methods using interop. /// public interface ITiming { /// /// This returns a number representing the number of milliseconds since system boot. /// /// The milliseconds since system boot. UInt32 Milliseconds { get; } /// /// This returns a number representing the number of microseconds since system boot. /// /// The microseconds since system boot. UInt32 Microseconds { get; } /// /// This causes program execution to pause for at least how long milliseconds. /// Due to the multi-tasking nature of Linux it could be longer. /// Note that the maximum delay is an unsigned 32-bit integer or approximately 49 days. /// /// The number of milliseconds to sleep. void SleepMilliseconds(UInt32 millis); /// /// This causes program execution to pause for at least how long microseconds. /// Due to the multi-tasking nature of Linux it could be longer. /// Note that the maximum delay is an unsigned 32-bit integer microseconds or approximately 71 minutes. /// Delays under 100 microseconds are timed using a hard-coded loop continually polling the system time, /// Delays over 100 microseconds are done using the system nanosleep() function – /// You may need to consider the implications of very short delays on the overall performance of the system, /// especially if using threads. /// /// The number of microseconds to sleep. void SleepMicroseconds(UInt32 micros); } }