# Help with millis()

I am a little confused with my program involving "millis()",

I am trying to keep track of intervals with seconds, not milliseconds.
What would be the process of converting "millis()" to keep track of seconds?

I have been having trouble with trying to modify it but I'm stuck.

a millisecond = 1000 seconds

Yes, I know the conversion. I simply want to make it so instead of milliseconds being shown in the serial monitor seconds are displayed instead. I am having trouble trying to define "millis()=millis()/1000"

Talor:
millis()=millis()/1000

Look at that again.
What do you think that code is doing?
If you don't know, print out the result.

Try

``````Serial.println( (millis()+500)/1000); //rounding
``````

ieee488:
a millisecond = 1000 seconds

That would be a kilosecond, ks, not a millisecond! (seldom used, as we call 3.6ks an 'hour')

``````long seconds ()
{
return millis() / 1000 ;
}
``````

jremington:
Try

``````Serial.println( (millis()+500)/1000); //rounding
``````

Do you round birthdays? When you're 6 months old you're also a year old?

Time is one of the few things where you usually want truncation instead of rounding.

where you usually want truncation

Not I. I want to know approximately how many seconds have passed, to the closest value.

I tend to consider, for example, 1.999 seconds as 2 seconds, but to each his/her own. People certainly do lie about their ages, often truncating much, much more than 6 months.

MarkT:
That would be a kilosecond, ks, not a millisecond! (seldom used, as we call 3.6ks an 'hour')

A brain fart.

Should read 1 seconds = 1000 milliseconds