sjlaube
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014
03:39 PM
wait seems to lose track of time
I have a command in my file which looks like
wait(18000,port)
At first it waits the full 18 seconds before continuing, but over time the wait time gets shorter, after an hour or so it is down to only waiting 8 seconds and after a day or two it is not waiting at all. If I restart my app then all is back to normal. I check and there is no activity on the port.
wait(18000,port)
At first it waits the full 18 seconds before continuing, but over time the wait time gets shorter, after an hour or so it is down to only waiting 8 seconds and after a day or two it is not waiting at all. If I restart my app then all is back to normal. I check and there is no activity on the port.
5 REPLIES 5

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014
04:52 PM
Re: wait seems to lose track of time
Its probably getting bored - 😄
However, you cannot get an exact timer that way, any activity on the port will release wait
may want to try getmessage and a timer:
timer = createobject('rotimespan")
msg = port.GetMessage()
if msg <> invalid then do something
if timer.GetMilliSeconds() >= 18000
do something and start over
timer.mark()
end if
However, you cannot get an exact timer that way, any activity on the port will release wait
may want to try getmessage and a timer:
timer = createobject('rotimespan")
msg = port.GetMessage()
if msg <> invalid then do something
if timer.GetMilliSeconds() >= 18000
do something and start over
timer.mark()
end if
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
sjlaube
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014
04:58 PM
Re: wait seems to lose track of time
Thanks so much, although I am pretty positive there is no activity on the port, since it degrades over time. But in any case I have implemented a timer like you suggest to guarantee the right amount of "wait time"
sjlaube
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014
05:08 PM
Re: wait seems to lose track of time
for anyone else looking, the call is actually
timer.TotalMilliseconds >= polltime
timer.TotalMilliseconds >= polltime

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014
05:17 PM
Re: wait seems to lose track of time
Sorry about that. But it is time for dinner
Anyway a wait timer can be unreliable

Anyway a wait timer can be unreliable
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2014
10:27 AM
Re: wait seems to lose track of time
"sjlaube" wrote:
timer.TotalMilliseconds >= polltime
That would be:
if timer.totalMilliseconds() >= polltime
- Joel