Notwithstanding the advice given above, what would you actually hope to accomplish? Replacing delay with millis is done to free up the processor to do other things while you wait. You typically find this in scenarios similr to blinking the LED off and on every second. Why wait that second in a do-nothing loop? In your case, you've got a 3ms and a 4ms delay that appear to be a part of how you want your tone exposed. How is changing this going to improve your code? Delays are, at times necessary, much the same as other maligned commands (GOTO??), or at least they make coding somewhat more straightforward. Replace it if you must, but before ever self-optimizing code, ask yourself why, and if you can't come up with a decent answer, don't. If it ain't broke, don't fix it.