Retrieves the timer name from the hTimer handle.
TimerGetName (hTimer)
Variable | Description |
---|---|
hTimer | The timer handle. HTIMER. |
TimerGetName returns the timer name if the timer handle, hTimer, is valid. If the timer handle is invalid, an exception is returned.
There is no check if the timer name is used multiple times. This function is provided for interfacing with Silk Performer; it is not needed for Silk Test Classic scripts.
[-] testcase timertest () appstate none [ ] [ ] HANDLE hTimer [ ] HANDLE hTimer2 [ ] STRING sTimerName [ ] STRING sReturnName [ ] // Create timer [ ] hTimer = TimerCreate () [ ] // Get the default name of the timer [ ] sReturnName = TimerGetName (hTimer) [ ] // Print returned name "Timer0" [ ] print (sReturnName) [ ] // Set timer name to "Timer0" [ ] sTimerName = "Timer0" [ ] [ ] // Create timer with name (for SilkPerformer) [ ] hTimer2 = TimerCreate ("Timer0") [ ] // Get the name of the second timer and print it [ ] sReturnName = TimerGetName (hTimer2) [ ] Print (sReturnName) [ ] // Prints timer name "Timer0" [ ] Print (TimerGetHandle (sReturnName))