4.4.21 Gestionarea timpului

Avem posibilitate de a măsura timpul folosit pentru anumite task-uri

Datele se vor transmite de la robot controller la driver station și vor fi afișate pe ecranul driver station-ului.

Ne vom asigura de existența instrucțiunii telemetry.update(); pentru ca datele să fie actualizate.

a means by which data can be transmitted from the robot controller to the driver station and displayed on the driver station screen

    //Initializam variabila start cu timpul initial
    long start = System.currentTimeMillis();

   
    waitForStart();
    //Atata timp cat opModeIsActive
    while (opModeIsActive()) {
        //variabila final va prelua timpul curent
        long final = System.currentTimeMillis();
        
        long timeElapsed = final - start;
 //In aplicatia FTC Driver Station se va afisa timpul scurs
        telemetry.addData("timp scurs%d",timeElapsed);
        telemetry.update();
    }
}