how to make a time function in arduino

please, How can i make a time function in arduino code like this (x=5*t)?

read about the millis() and micros() functions

uint32_t lasttime = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  uint32_t t = millis();
  uint32_t  x = 5 * t;
   if (t - lastTime > 1234)
  {
    lasttime = t;
    Serial.print(t);
    Serial.print("\t");
    Serial.print(x);
    Serial.println();
  }
}

Using millis() you can make things happen on time.
You can also get the time between events like pin changes or serial input.
Your code can relate and react in time with these.

monsterous:
please, How can i make a time function in arduino code like this (x=5*t)?

What is t in this context?

As pointed out you can use millis() to get elapsed time, and Rob gave you code to multiply that by 5.

But if you mean time as in time-of-day then you'll need some or other Real Time Clock (RTC) chip like a DS1307. Libraries then allow you extract the hour, minute, second from the time-of-day and you can do stuff with those values.

There's something I haven't mucked with on my Teensy 3.1. IIRC it has an internal RTC.

BTW, my favorite time standard is UNIX time, 32-bit seconds since the start of 1970.
It synch's up really easy.