Timing.app is really good for this purpose. I use it every day, but I am not affiliated with the company in any way.
Essentially it uses the accessibility features on MacOS to see what you are doing and generate time entries for you.
Essentially it uses the accessibility features on MacOS to see what you are doing and generate time entries for you.