Oasys.REPORTER.Utils class¶
Static methods¶
- classmethod Utils.Build()¶
Returns the build number
- Returns:
integer
- Return type:
int
Example
To get the current build number
build = Oasys.REPORTER.Utils.Build()
- classmethod Utils.CallPromiseHandlers()¶
Manually call any promise handlers/callbacks in the job queue
- Returns:
no return value
- Return type:
None
Example
To run any queued promise handlers/callbacks:
Oasys.REPORTER.Utils.CallPromiseHandlers()
- classmethod Utils.GarbageCollect()¶
Forces garbage collection to be done. This should not normally need to be called but in exceptional circumstances it can be called to ensure that garbage collection is done to return memory
- Returns:
no return value
- Return type:
None
Example
To force garbage collection to be done:
Oasys.REPORTER.Utils.GarbageCollect()
- classmethod Utils.HiResTimer()¶
A high resolution timer that can be used to time how long things take. The first time this is called the timer will start and return 0. Subsequent calls will return the time in nanoseconds since the first call. Note that the timer will almost certainly not have 1 nanosecond precision but, depending on the platform, should should have a resolution of at least 1 microsecond. The resolution can be found by using
Utils.TimerResolution()
Example
To time how long something takes to nanosecond precision:
start = Oasys.PRIMER.Utils.HiResTimer() #do something that takes some time... end = Oasys.PRIMER.Utils.HiResTimer()
- classmethod Utils.TimerResolution()¶
Returns the resolution (precision) of the
Utils.HiResTimer()
timer in nanosecondsExample
To find the resolution of the timer in nanoseconds:
resolution = Oasys.REPORTER.Utils.TimerResolution()
- classmethod Utils.Version()¶
Returns the version number
- Returns:
real
- Return type:
float
Example
To get the current version number
version = Oasys.REPORTER.Utils.Version()