Returns the total number of milliseconds in the timeout.

Namespace:  Quanser.Common
Assembly:  Quanser.Common (in Quanser.Common.dll)

Syntax

Visual Basic (Declaration)
Public Function GetMilliseconds As Integer
C#
public int GetMilliseconds()
Visual C++
public:
int GetMilliseconds()
JavaScript
function getMilliseconds();

Return Value

Returns the total number of milliseconds in the timeout. If the timeout is too large to be represented, then -1 is returned. If it is too small to be represented, or is negative, then 0 is returned.

Remarks

If the timeout is absolute then it is converted to a relative timeout prior to computing the number of milliseconds, so that the return value is always relative. If the total number of milliseconds in the timeout exceeds the maximum value representable by an integer then -1 is returned.

If the timeout is less than a millisecond or negative then zero is returned. This method is primarly used for calling .NET methods that require a timeout in milliseconds. Since none of these methods understand a negative number of milliseconds, the GetMilliseconds()()() method always returns a non-negative result.

Exceptions

ExceptionCondition
Quanser.Common..::.GenericException A GenericException is thrown if the timeout is absolute and cannot be converted to a relative timeout. This error will have been propagated from the GetCurrentTime()()() method.

See Also