package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.TeleOp;

@TeleOp(name="production ready opmode 1.1")
public class GamepadPerf extends Gamepad {
    private long lastTime = 0;
    @Override
    public void init() {
        this.construct(true);

        api.print("Status", "Initializing, please wait");
        api.clear();
        api.print("Press play to start");
    }

    @Override
    public void start() {
        api.clear();
        lastTime = System.currentTimeMillis();
    }

    @Override
    public void loop() {
        long currentTime = System.currentTimeMillis();
        long diff = currentTime - lastTime;
        api.print("Last iteration took " + diff + "ms");
        lastTime = System.currentTimeMillis();
    }

    @Override
    public void stop() {
        api.print("Stopping!!!");
        super.stop();
    }
}
