Martin Thoma
Martin Thoma

Reputation: 136419

How do I get the sampling rate of a canvas element?

I am currently investigating preprocessing for on-line handwriting recognition (see http://write-math.com). One interesting property of input devices is the sampling rate, that means the rate at which I get onmousemove and similar events.

I can record them and see the time delta between two events is varies from 1.00 ms - 700.00 ms, but is in average 27.34 ms for this recording.

(sampling rate is measured in Points / second. So the sampling rate would be enter image description here or for the average case enter image description here)

Is there any possibility to get this information from the client directly? Are there devices where the sampling rate is known? How does Javascript internally decide how often to fire those events? Can the "event firing rate" be increased / decreased?

Upvotes: 1

Views: 188

Answers (1)

markE
markE

Reputation: 105035

Mousemove firing rates for a particular browser are stable over a sufficient sample size, but the firing rate of any individual mouse event is affected by non-canvas activities (garbage collection, background tasks, etc).

I don't know of any browser that allows adjustment of the mousemove timing--all internally defined.

Interesting project!

Upvotes: 1

Related Questions