Setting delay time between 2 digitalWrite functions

There is a "blink without delay" example sketch that might give you ideas. Also: