ut i dont know how i would make the code?
Use millis() + 1000 to get the time for the next change. Then keep checking millis() until it is greater than this figure. When it is output the next count and set the time for the next count.
The same idea I used in :-
http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html