Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2604

Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2604

Warning: Trying to access array offset on value of type bool in /home/cycos/cammy.co.jp/public_html/technical/wp-content/themes/cocoon-master/lib/utils.php on line 2632

mills

説明

プログラムがスタートしてからの経過時間をミリ秒で返します。
プログラム開始から約50日後にオーバーフローし、数値は0にリセットされます。

構文

time=mills()

戻り値

データ型: プログラムが開始されてから経過したミリ秒数

引数

なし

プログラム例

unsigned long myTime;

void setup() {
  Serial.begin(9600);
}
void loop() {
  Serial.print("Time: ");
  myTime = millis();

  Serial.println(myTime); // prints time since program started
  delay(1000);          // wait a second so as not to send massive amounts of data
}

 

タイトルとURLをコピーしました