using two or three objects of millis function

i want to use two or more objects of millis function
ie a=millis();
b= millis();
the problem i am facing is that both corresponds to same clock of arduino,even though b variable is initiated later it will show the same time as of a .i need to track different times using two different objects of millis. and one more thing is there any method to stop millis for sometime during program.

b variable is initiated late

How much later?
Attach your sketch.

You want them to be the same or not the same? They will be the same for up to a millisecond. Is that a problem? How about using micros() ?

anujaggarwal:
i need to track different times using two different objects of millis. and one more thing is there any method to stop millis for sometime during program.

The usual way to use millis() is like this pseudo code

void setup() {
    prevMillisA = millis();
    prevMillisB = millis();

void loop() {
    currentMillis = millis();
    if (currentMillis - startMillisA >= intervalA) {
        // do something
        prevMillisA += intervalA;
    }
   // etc etc
}

With this system you can track as many different times as you like without ever needing to stop millis()

...R

one more thing is there any method to stop millis for sometime during program.

Tell me - how often do you feel the need to walk over to the kitchen clock and take the battery out?

A millisecond is a millisecond whatever way you look at it. millis() simply gives the number of milliseconds since the arduino was last booted.

When you go to work you know what time you need to arrive because of the time. When you catch a bus you know what time it should arrive because of the time. When you have a doctors appointment you know what time you need to get there because of the time. You don’t need a separate time zone for all of those unrelated activites.

Likewise if you want to run several different tasks at different intervals you just relate them all to the same internal clock. Each using their own schedule.

For example

byte LEDarray[8][8][8];

int LED1=13;
int LED2=12;
int LED3=11;

void setup()
{
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);

}
void loop()
{
//blink this LED once every half second
serviceBlink(LED1,250,500);
//blink this LED once per second
serviceBlink(LED2,500ul,1000ul);
//flash this one for a 123 microseconds every every 2.47 seconds
serviceBlink(LED3,123,2470);
}

void serviceBlink(int pin,unsigned long howLong,unsigned long period)
{
unsigned long frame=millis()%period;
digitalWrite(pin,(frame<howLong));
}

you need - http://playground.arduino.cc/Code/StopWatchClass -