Work in physics is mathematically defined as force $F$ applied on an object multiplied by the displacement $d$ it covers in the direction of the force. In a system where, a restrictive force exists like friction due to contact between objects or in a field where work done changes into potential energy, displacement is finite.But according to Newtons second law of motion when a force is applied on an object, it produces acceleration in that object which causes a change in velocity in a "certain" time. Moreover when the force has been applied, according to Newtons 1st law of motion it should displace "infinitely" with a constant velocity which is changed due to the force applied. My question here is that what is the real definition of 'displacement' in work formula?
$$ W = F d \cosθ$$
Is the displacement infinite making work infinitely increasing or it is the displacement covered by that object while the force is being applied or when there is acceleration being produced?