Suppose $n=pq$, where $p,q$ are prime numbers.
Let $p ( \le q)$ be the smallest prime, then we know that $p \le \sqrt{n}$.
In trail division, we check $n \mod i$ for the values of $i$ from 2 to $\sqrt{n}$, to find the value of $p$ and then we calculate $\dfrac{n}{p}$ to get $q$.
In general, the time complexity is (assuming finding remainder and division takes place in constant time) $\sqrt{n}$.
How to calculate cryptographic time complexity?
Suppose $b$ is the number of bits to represent $n$ in binary format, then can I directly substitute in $\sqrt{n}$, so that I can get $2^{\frac{b}{2}}$.
Or should it be calculated as $(\sqrt{n}-1)*$ time taken for modulo operation $+$ time taken for division?
How to arrive at time complexity in terms of $b$?
How much time does it take for calculating modulo and division in terms of bits? If we substitute those values, finally should we get $2^{\frac{b}{2}}$?