fun fib 0 = 0
|fib 1 = 1
|fib n = fib (n-1) + fib (n-2);
What's the cost to calculate $fib (n)$? For $n \geq 2 $, the cost is the cost of recursive calls, plus one to sum them together (setting unit cost to be addition). We need to solve the recurrence relation
$$ T(n) = T(n-1) + T(n-2) + 1$$
We could work $T(n)$, the time taken to compute the nth Fibonacci number exactly, but then we might as well solve for $fib(n)$ - the recurrence relation is very similar. Rest assured, the cost to compute using this method is exponential.
Let's assume an exponential value for the nth value of the Fibonacci sequence
$$ fib(n) = A\omega^n $$
substituting in,
$$ A\omega^n = A\omega^{n-1} + A\omega^{n-2} $$
$$ \omega^2 - \omega - 1 = 0 $$
$$ \omega_1 = \frac{-1 + \sqrt{5}}{2}, \omega_2 = \frac{-1 - \sqrt{5}}{2}$$
Since we have two solutions for $\omega$, the most general solution is
$$ fib(n) = A\omega_1^n+ B\omega_2^n $$
where $A$ and $B$ are arbitrary constants. To find the values of these constants, use the contraints $fib(0) = 0$ and $fib(1) = 1$
$$ A + B = 0 $$
$$ A\omega_1 + B\omega_2 = 1$$
$$ A\omega_1 + (1-A)\omega_2 = 1$$
$$ A = \frac {1}{\omega_1 - \omega_2}$$
$$ A = \frac {1}{\sqrt{5}} , B = - \frac {1}{\sqrt{5}} $$
So, noting that $\omega_2 = 1-\omega_1$, we have the solution for $fib(n)$:
$$fib(n) = \frac{1}{\sqrt{5}} (\omega_1^n - (1-\omega_1)^n)$$
How long does it take to compute using this method? Using a machine that can exponentiate in contant time, constant time! Of course, no such machines exist, most machines can multiply in constant time, thus exponentiate in logarithmic time. On a real machine, however, we cannot represent a non-rational number exactly, so we may introduce floating point errors, and have to round the answer to the nearest integer. This is pretty messy, so a more preferable method is to use dynamic programming. This is an optimisation of the ML implementation above, where we may calculate the same fibonacci value multiple times - e.g.

fun fib n = let fun fibcalc 0 x y = x
|fibcalc n x y = fibcalc (n-1) y (y+x)
in
fibcalc n 0 1
end;
Here, we work 'bottom up' to construct $fib(1), fib(2), ... , fib(n)$ which uses constant stack space and still takes linear time.