Aggregation over transacations

Is it possible to see what % of time my project spent in a specific operation?
I’m trying to evaluate whether a piece of code is worth optimization and getting this aggregation would be super helpful.

I tried using discover but it doesn’t seem to provide to this functionality.