Either look at Benchmarking or Profiling.
Profiling:
Most IDE's support profiling:
In software engineering, profiling ("program profiling", "software
profiling") is a form of dynamic program analysis that measures, for
example, the space (memory) or time complexity of a program, the usage
of particular instructions, or the frequency and duration of function
calls.
The profiler measures how long each function call costs and gives you a nice report. This would be the way to check what your Save()
function is doing for how long.
Which profiler to use is programming language depended so you need to do some research or ask a more specific question with programming language details.
Profiling more a developer task then a tester task, but performance is a key issue in software quality so understanding these concepts makes sense.
Benchmark:
In computing, a benchmark is the act of running a computer program, a
set of programs, or other operations, in order to assess the relative
performance of an object, normally by running a number of standard
tests and trials against it. The term 'benchmark' is also mostly
utilized for the purposes of elaborately designed benchmarking
programs themselves.
In this case you may use an end-to-end testing tool and record the length of the test-case and record this as a benchmark. In the future you compare test-runs to this benchmark to see if it became slower or faster.