How can I measure the cumulative network usage of a process, from execution beginning to end

I want to measure how much bandwidth git pull uses, preferably by prefixing git command with desired program, i.e. nettally git pull

Alternatively, is there some sneaky way to accumulate nethogs / wireshark data and add up the figures after execution?

Thanks


If you launch nethogs and then press the m key, it will switch from instantaneous mode (kB/s) to cumulative mode (kB).