Topic
2 replies Latest Post - ‏2013-04-06T17:49:27Z by Yevo
SystemAdmin
SystemAdmin
1305 Posts
ACCEPTED ANSWER

Pinned topic Read current timeout Timer value

‏2013-04-06T16:35:58Z |
Hi,

I'm trying to do very simple progress bar displayed in a command console based on a progress of timeout that was defined in a state chart.

On my state chart I have defined a transition with "tm(smTime)" that lasts 10 secs.
Now in Action on Entry in some State I'm trying to do something like this :
while (i < smTime) //true as long as timeout hasnt passed
{
i=getReadTimeout(); //read current timer value
if (i < 0.5*smTime)
{x=0;} //if timer value is less than 1/2 of its limit x=0
else
{x=0.5;} //if timer value is more than 1/2 of its limit x=0.5
System.out.print( x + " \r");
}
But I couldnt find any function that would let me read current timer value, that getReadTimeout(); was found somewhere in IBM help files.

Any help appreciated.
Updated on 2013-04-06T17:49:27Z at 2013-04-06T17:49:27Z by Yevo
  • Yevo
    Yevo
    261 Posts
    ACCEPTED ANSWER

    Re: Read current timeout Timer value

    ‏2013-04-06T17:44:43Z  in response to SystemAdmin
    If you use OXF framework, OMTimerManager::instance()->getElapsedTime() in C++ or RiCTimerManager_getElapsedTime() in C return current time. Take into account its accuracy depends on timer resolution.
    • Yevo
      Yevo
      261 Posts
      ACCEPTED ANSWER

      Re: Read current timeout Timer value

      ‏2013-04-06T17:49:27Z  in response to Yevo
      Example of usage in C:

      timeUnit currentTime = RiCTimerManager_getElapsedTime(RiCTimerManager_getSystemTimer());

      See more details in sources of OXF (Share\LangC\oxf or Share\LangCpp\oxf directories)