If you are not against the usage of AOP you can achieve it as per this article:
https://blog.devops.dev/how-to-create-custom-annotation-for-measuring-method-execution-in-java-263d02872ef1