New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idle time over 100% in writing statistics #1149
Comments
Hmm, that should technically not be possible. The session time is calculated from the time you closed the project minus the time you opened it, so it should not be possible for the idle time to be larger than this interval. So. this only happens in the first session, but not after that? If so, it could just be some initialisation issue. Perhaps the idle time value is inherited from the previous project when you create a new one. It is not intended behaviour anyway. |
Woop. Managed to reproduce it. When you create a new project from the open dialog immediately when you open novelWriter, the idle time is not zeroed. It includes the time you took to create the project itself it seems. There is clearly a zeroing out of idle time missing somewhere. This is a bit of a corner case, but it should be easy enough to track down. |
Note to self. These two lines need to be added to the newProject method in GuiMain: self.idleRefTime = time()
self.idleTime = 0.0 It is indeed including the time you spent creating the project in the idle time calculation, but the session itself doesn't start until the project is created. Hence you'll get a few tens of seconds additional idle time. |
I looked at my 100% idle sessions again, and it seems I and confused idle time with length. So the issue indeed only occurs when creating a new project like you described. |
Yeah, the values are properly reset when you open a project, and when you close one. Creating a new project is neither of those, and instead a weird in-between state. I'm considering rewriting the new project feature to just generate it on disk and then do a normal open project process. That way, these corner cases cannot happen. Opening and closing projects is well tested in the test suite, creating new ones during runtime isn't. This is not the first such issue. |
The idle time of a project's session statistics can reach more than 100%. The idle time in a .csv export will be greater than the total time:
To reproduce, create new project, write a few words, loose focus of novelWriter, wait some time, close novelWriter, open again and examine statistics.
This occurred in all my project's first sessions and in some other it was rounded to 100%, but the idle time was greater than the session length.
I'm not sure if this is a feature I don't understand or an issue related to time measuring during project creation. However, for me this has low priority, it just looks weird.
The text was updated successfully, but these errors were encountered: