  Resetting a stochastic process has been shown to expedite the completion time
of some complex tasks, such as finding a target for the first time. Here we
consider the cost of resetting by associating to each reset a cost, which is a
function of the distance travelled during the reset event. We compute the
Laplace transform of the joint probability of first passage time $t_f$, number
of resets $N$ and total resetting cost $C$, and use this to study the
statistics of the total cost and also the time to completion ${\mathcal T} = C
+ t_f$. We show that in the limit of zero resetting rate, the mean total cost
is finite for a linear cost function, vanishes for a sub-linear cost function
and diverges for a super-linear cost function. This result contrasts with the
case of no resetting where the cost is always zero. We also find that the
resetting rate which optimizes the mean time to completion may be increased or
decreased with respect to the case of no resetting cost according to the choice
of cost function. For the case of an exponentially increasing cost function, we
show that the mean total cost diverges at a finite resetting rate. We explain
this by showing that the distribution of the cost has a power-law tail with a
continuously varying exponent that depends on the resetting rate.
