javascript works now (I think)
corrected time measurement