Study this example of One-shot Operation Timer in Programmable Logic Controllers (PLC).
The done bit comes on after its specified time period even if the input is turned off during the timing period.