001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.wpilibj.command;
006
007import edu.wpi.first.wpilibj.Timer;
008
009/**
010 * WaitUntilCommand - waits until an absolute game time. This will wait until the game clock reaches
011 * some value, then continue to the next command.
012 */
013public class WaitUntilCommand extends Command {
014  private final double m_time;
015
016  public WaitUntilCommand(double time) {
017    super("WaitUntil(" + time + ")");
018    m_time = time;
019  }
020
021  /** Check if we've reached the actual finish time. */
022  @Override
023  public boolean isFinished() {
024    return Timer.getMatchTime() >= m_time;
025  }
026}