millis ,questions from noob

Hy,so i tried to gasp the millis function usage in codes,but i still have some doubts,can someone help me with these really simple questions:

1.millis acts as counter from when the fist function is run,if we use variable currentmillis = millis,
it just copy the current counter time in that variable,correct?

2.We can replace any delay time or run time by: currentmillis - millis >= delay time.
so in theory any time expressed by milliseconds can be replaced using that function,correct?

3.If i use period = 1 ,will it be able the cop with that small time and not break the code,so it just automatically sets period to milisecond,so i can multiply it with desired time of delay or run of some funcion or statement,correct?

Robin2's discussion will answer everything you asked:

http://forum.arduino.cc/index.php?topic=223286.0

More information:

https://forum.arduino.cc/index.php?topic=525240.0

https://forum.arduino.cc/index.php?topic=526696.0

Using millis() for timing. A beginners guide

it answers most of my questions but not the main one

If i use period = 1 ,will it be able the cop with that small time and not break the code,so it just automatically sets period to milisecond,so i can multiply it with desired time of delay or run of some function or statement,correct?

If you set period to 1 and use that in the time now minus start time comparison it will provide a 1 millisecond timing period. No problem. No surprise there.

You can multiply the value of period by the required value but why would you ? You might as well just set it to the required period.

I assume that you understand that millis() is not a drop in replacement for delay()

millis is not but,deduction of currenttime - millis is.
isn't it?

turbogt16v:
millis is not but,deduction of currenttime - millis is.
isn't it?

Sorry, but I don't understand the question.

currenttime - millis is meaningless.

The test is

if (currentTime - startTime >= period)
{
  //period has ended.  Do something
}

That will work with any integer value of period as long as the period is less than 49 and a bit days expressed as milliseconds

For very short time intervals it probably makes more sense to use micros(). It can be used just like millis().

...R