Executing function time

how could I find out how long is some function executing?

is this number, however small, always consistent for the same function or there may be differences (taking in consideration that only one function is running at each moment)?

what does it all depend at?

frame rate, computer stength…?