I think you mean to ask the amount of CPU time spent to execute code in a particular module or instance of a module. Look at Questa/Modelsim Profiling tools in the User Guide, or whatever tool you are using. Assuming your DUT is in one set of modules and your testbench is in another set of modules, the amount of CPU time spent for each should be easy to analyze.
The amount of time to communicate between modules is a difficult concept to define. The elaboration and optimization phases gets rid of much of the module hierarchy before simulation starts, And its difficult to distinguish the logic in a module that is only there to communicate with another module .