Jannchie / codetime-web-v3

Front-end page of codetime, third version.
https://codetime.dev
21 stars 1 forks source link

add support for tracking typing time as well as reading/watching time #7

Open distbit0 opened 2 months ago

distbit0 commented 2 months ago

It would be very useful to be able to track time spent actually typing as opposed to time spent reading/watching. Especially when writing markdown notes which I often refer to without editing. Just leaving vscode open should not count towards typing time. many thx

Jannchie commented 2 months ago

Indeed, it is possible to distinguish between typing and reading. However, my initial thought was that even reading/reviewing code should also be considered as programming time.

Perhaps I can add an option in vscode to report only input events, without reporting events such as opening files for reading.

distbit0 commented 2 months ago

I think that for calculating billable hours, you are probably right that in many cases reading time counts as programming time. However at least for me, with the goal of measuring my personal productivity, I think that typing time is a much better heuristic. This is because sometimes I just scroll through my notes (which I edit in vscode as well as code) without editing them, which is not very productive lol but which codetime counts towards my writing time.

thx :)

distbit0 commented 2 months ago

I think that ideally "typing time" would count as all time within x seconds of a keystroke. So e.g. if x is 15 seconds, typing time would continually increase as long as I type at least every 15 seconds.

Jannchie commented 2 months ago

In fact, our algorithm is simpler. To simplify storage, our smallest unit is 1 minute, and we will record the file with the most operations within that minute. This may not be very accurate, but it won’t introduce significant errors on a macro scale.

distbit0 commented 2 months ago

That works for me :) But at the moment it looks like it is recording minutes even where I have not made any keystrokes/typed any text, which is not ideal :/