Help with decreasing program loop time

Thanks anyway fixed my own problem. I took out the digitalwrites and used port manipulation.