Description
Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.
Experimental timing depends on clock origin, display refresh, exclusion rules and observation windows. Requested, quantized and actually measured times are different quantities, and a timing residual alone does not establish a psychological effect.
Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.
When to use this tool
Use Stimulus Frame Quantization Error when you need an explicit experiment-timing or latency term.
How to use the tool and how it works
- Enter timeSeconds, frameRate. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read nearestFrame, quantizedSeconds, errorSeconds. Use the output convention below.
Require positive frame rate. Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| timeSeconds | Time Seconds | Required. Finite number. |
| frameRate | Frame Rate | Required. Finite number; strictly above 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| nearestFrame | Nearest Frame | Required. Safe integer. |
| quantizedSeconds | Quantized Seconds | Required. Finite number. |
| errorSeconds | Error Seconds | Required. Finite number. |
{
"input": {
"timeSeconds": 1.25,
"frameRate": 2
},
"output": {
"nearestFrame": 3,
"quantizedSeconds": 1.5,
"errorSeconds": 0.25
}
} Limitations and assumptions
- Negative times are allowed and half ties follow Math.round toward positive infinity. This quantizes a coordinate, not a guaranteed hardware presentation time.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use calibrated presentation and response hardware and the study's analysis protocol. Check raw timestamps, censoring, exclusion policy and uncertainty before interpreting timing contrasts.
References
Similar or alternative tools
- Experimental Psychology: Stimulus Frame Duration Rounding
Floor, ceil or nearest-half-up to whole frames and return realized duration and residual.
- Response Time Quantization Gap
Round responseTime/quantum with Math.round, rescale and return second-minus-first quantized time.