How can I run a function for a certain duratio…

How can I run a function for a certain duration and then not run it again for a different duration?:

#arduino