@masukomi to track this, I use WakaTime [1]. A horrific service, it has plugins for basically everything (including terminal-based editors, Unix shells, and web browsers) to track time automatically. I then use a GitHub Action called "waka-box" [2] which converts it into an ASCII art GitHub Gist that I can pin on my profile.
[1]: https://wakatime.com/
[2]: https://github.com/matchai/waka-box