How can i execute a task in a specific duration

I have a process in which independently of the flow as long as i'm  within a spicific duration i can execute a task.