0

I'm using $timeout in AngularJS and my delay is is microseconds but the documentation says the delay takes millseconds. Will my parameter get rounded up, down or truncated? I can't seem to ascertain anything from the source code either. Any insights?

user153882
  • 337
  • 1
  • 3
  • 15
  • Eventually the value just gets deferred to Javascript's `setTimeout`, which is too coarse to accept µs values. – deceze May 22 '17 at 00:35
  • @deceze so does that mean if I passed microseconds, it will default to 4ms? or would it be thrown away? – user153882 May 22 '17 at 01:04
  • AFAIK it depends on the browser, but most likely it'll default to 4ms. The alternative is that the event happens basically instantaneously. You simply do not have control over timing to such a precise degree in Javascript, so I wouldn't even worry about how *exactly* it'll misbehave. – deceze May 22 '17 at 01:07

0 Answers0