Robot Programming - Delay by variable

Hello there, we are simulating a robot spot welding process and we would need to have variable welding time. We have tried adding a variable to a delay function without success. How could we do it?

Thanks in advance!