i tried to run
1.start one timer in initialize and the second in execute and subtract the last one from the first but the values are very small
2. run both timers in initialize and find delta in execute
my code commands
public Timer st_Timer = new Timer();
public Timer cur_Timer = new Timer();
public FollowTrajCommand() {
// each subsystem used by the command must be passed into the
// addRequirements() method (which takes a vararg of Subsystem)
addRequirements(subsystem);
}
@Override
public void initialize() {
cur_Timer.start(); // cur timer
st_Timer.start(); // start timer
}
@Override
public void execute() {
double dT = cur_Timer.get() - st_Timer.get();
SmartDashboard.putNumber(“start time”, st_Timer.get());
SmartDashboard.putNumber(“cyr time”, cur_Timer.get());
SmartDashboard.putNumber(“deltaTime”, dT);
}