If this is just a scripted display of text, have you tried using Install OnTimer. Performance may very with the speed of the client and resolution better 1/10s may not be possible. Just an idea and not sure this will help in any way.
thank you for your quick replay.
I used your example on a stand-alone Mac and added a simple check for measuring time in your loop with Get (CurrentTimeUTCMilliseconds) before and after the text is displayed and found that for slower speeds is very accurate but for faster speeds there is some extra significant delay.
- using 2 sec I found real time is about 2070 msec (quite accurate)
- using 1 sec I found real time is about 1075 msec (quite accurate)
- using 0,5 sec (1/2 sec) I found real time is about 560 msec (discrepancy fairly acceptable)
- using 0,25 sec (1/4) sec) I found real time is about 319 msec (not terrible but would be closer to 1/3 sec )
- using 0,1 sec (1/10 sec) I found real time is about 166 msec (which is more than 50% extra delay)
- using 0,05 sec (1/20 sec) I found real times about 118 msec (which is about double than expected)
- using 0,025 sec (1/40 sec) I found real time about 95 msec (which is far from expected)
Is my check wrong ? or maybe just a Filemaker limit ?
Hello again Siplus,
attached is the example file you sent me some time ago.
In that case real time was just perfect since discrepancy is only 2 msec even for very fast speeds of 1/50 sec and 1/100 sec.
I was trying to integrate such routine in the typewriter solution but didn't find how.
Your counts show about 70ms delay on every test, so you can use (specified value - 0.07) sec for your script.
Since the WebViewer in filemaker is fairly independent to the rest of FileMaker and uses the OS web engine for rendering it should work very well.
interesting option and very nice example.
Btw, I don't have deep experience in HTML/Java and I want to have full control of scripting and options (i.e. don't want to copy something without fully understand what is going on...)
The tachistoscopic example works fine even for very fast speeds like 1/50 and 1/100 sec with a discrepancy of only 2-3 msec so I think it is a matter of winning the challenge and make it works inside Filemaker
no, the delay is not constant 70 msec. The delay is bigger with faster speeds.
Machine, platform, HD, RAM, FM Version etc - all can (and will) influence the precise timing you're after.
The Delay script needs to be precisely calibrated on the machine you are using, there's no doubt about it.
But I tried your TimingTest on 3 different Mac: 1 iMac of 2015 8Gb RAM, 1 MacBook of 2010 4Gb RAM and one MacMini of 2011 4Gb RAM and it works fine all all three with discrepancy of timing of less 4 msec.
Which is excellent !
So i think the secret is to implement in some way the TimingTest routine into the Typewriter output instead of using a Delay routine.
"- using 2 sec I found real time is about 2070 msec (quite accurate)"
2070ms - 2sec = 70ms
"- using 0,025 sec (1/40 sec) I found real time about 95 msec (which is far from expected)"
95ms - 0.025sec = 70ms
try to comment out the useless boulder I've put into the loop and see if you get a change:
Set Variable [ $i ; Value: Get(ScriptParameter) * 1000 ]
Set Variable [ $now ; Value: Get ( CurrentTimeUTCMilliseconds ) ]
Exit Loop If [ Get ( CurrentTimeUTCMilliseconds ) ≥ ($now + $i) ]
// Set Variable [ $uselessVar ; Value: Get ( RecordModificationCount ) ]
I didn't find any change.
- using 0,1 sec (1/10 sec) I found real time is still around 165 msec (some 60-65 msec delay)
- using 0,05 sec (1/20 sec) I found real time is still 118 msec (some 80-82 msec delay)
- using 0,025 sec (1/40 sec) I found real time is still around 93 msec (about double delay))
Some time ago I demonstrated that a script consisting only of comments does take some time (ms) to be "executed"; the more comments the more time.
Instead of using a loop with an if, you could build scripts taking exactly the time you need by adding or subtracting comments to a script that otherwise does nothing. That would give you the building blocks you are looking for.