digitalWrite() length of time HIGH help

Simple question here. Sorry. What is the best way to digitalWrite() HIGH having a set length of time? I don't want to use delay() as it will stop the program. Thanks for the advice!

Note when you turned the pin on. Periodically, see if it is time to turn it off, if it is on. See the blink without delay example for how.

Thank you!

The demo Several Things at a Time is an extended example of BWoD. It may help with understanding the technique.