- Home /
EditorWindow update Time.deltaTime is 1x10^-5?
In the docs, it says EditorWindow.Update is called 100 times a second.
When I call Time.deltaTime from my editor window update, I get 1x10^-5. That's 1000 times smaller than I'd expect.
But here's the thing, when I use 0.01f for the time, it's too fast. The actual value is closer to 0.005, or about 200 times a second.
What gives? Something I've done wrong? Nobody else is having this issue? It's a frame-based animation editor so I need the time to be reasonably accurate.
Answer by Bunny83 · Oct 19, 2015 at 02:43 PM
Time.deltaTime was never ment to be used in editor code. It's a pure runtime value. In the editor it returns a constant value of 10^-5 as you already mentioned.
However i can confirm that EditorWindow.Update as well as the generic EditorApplication.update delegate now seem to run at 200 calls per second. I know for sure (99.9%) that it actually was 100 in the past. So either they have changed it but haven't adjusted the documentation or they have changed it accidentally during some kind of refactoring ^^. Either way it's not consistent accrding to the documentation.
So feel free to post a bug report in Unity. I will do as well. However i'm still not sure under which category, "documentation" or "Unity editor" :). I think "Unity editor" will be better as the documentation is what we expect, even when it's actually the documentation that might be outdated.
edit
I also just dicovered that the callrate changes to the games FPS rate when you are in playmode. So with the usual vsync and 60Hz monitor i get 60 calls per second in playmode and 200 in edit mode. That not necessarily is a bug, but it would be nice if it would be mentioned in the docs.