A system undergoes minimal repair during [0,T] with a failure replacement on first failure during [T,a], or a planned replacement if the system is still functioning at elapsed time a. Repairs and replacements are not necessarily instantaneous. An expression is obtained for the asymptotic expected cost rate, and sufficient conditions are obtained for the optimum T*>0. Several special cases are considered. A numerical investigation for a Weibull distributed time to first failure compares this elapsed-time policy with replacement on failure only, and also a policy based on system operating time or age. It is found that in many cases the elapsed-time-based policy is only marginally worse than one based on system age, and may therefore be preferred in view of its administrative convenience.