M
M100C
My son is learning his multiplication facts, and I've built a nifty
little browser applet that runs with javascript. I pass a randomly
constructed math fact (e.g. "6 X 7 =") to a prompt box, and await his
input. However, I'd like to capture how long it takes him to answer
the prompt. I've tried something like this:
var date = new Date()
var time = date.getTime()
response = prompt (fact)
time = date.getTime() - time
and
var s_date = new Date()
var e_date = new Date()
var s_time = s_date.getTime()
response = prompt (fact)
var e_time = e_date.getTime()
var time = (e_time - s_time) / 1000
but, when I watch these variables, they are assigned the same time.
Not sure what I am doing wrong. Any suggestions?
little browser applet that runs with javascript. I pass a randomly
constructed math fact (e.g. "6 X 7 =") to a prompt box, and await his
input. However, I'd like to capture how long it takes him to answer
the prompt. I've tried something like this:
var date = new Date()
var time = date.getTime()
response = prompt (fact)
time = date.getTime() - time
and
var s_date = new Date()
var e_date = new Date()
var s_time = s_date.getTime()
response = prompt (fact)
var e_time = e_date.getTime()
var time = (e_time - s_time) / 1000
but, when I watch these variables, they are assigned the same time.
Not sure what I am doing wrong. Any suggestions?