Bob wrote:
>> General question: What is your experience with running JavaScript
>> functions based upon timers?
>>
>> I am thinking of polling for events rather than callbacks.
>>
>
> If I read your question correctly, you are suggesting letting the
> JavaScript
> loop for events from the applet and perhaps have public access to
> variables that
> would indicate, for example, that a script has run, that the message
> buffer has
> been loaded, etc.?

Correct ... that is what I am wondering about.

> Callbacks seem to me to be ultimately more efficient than polling.

One would think so.

But I saw a posting that said that under Mozilla calling from Java to
JavaScript was up to 40,000 times slower than from calling from JavaScript
to Java.


> My experience with setTimeout() is that it is a necessary evil for quick
> jumps
> to a new thread, allowing a sort of poor man's doevents() (from Visual
> Basic)
> but is not very efficient for continuous polling.
>
> But it might be something to try.

I am not familiar with doevents()

Rather than have many functions do the polling, I am thinking of 1
function that does the polling. One that I write and put into Jmol.js

Still just an idea.


Miguel



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to