Class StopWatch

Class Documentation

class StopWatch

solver.h

Purpose: Primary function is to define the Solver() class which is what runs for the entire program. It also

Copyright (C) 2018 Zayd Hammoudeh. All rights reserved.

Author
Zayd Hammoudeh zayd@ucsc.edu
Version
0.00.00

This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.

Original Author: Marc Thurley.

Public Functions

StopWatch()

Used to track time events in the execution of the solver.

Built using the internal C++ timer (i.e., timeval()). Resolution down to microseconds via the “tv_usec” property.

solver.cpp

See
timeval

Purpose: Defines the methods for the Solver() class.

Copyright (C) 2018 Zayd Hammoudeh. All rights reserved.

Author
Zayd Hammoudeh zayd@ucsc.edu
Version
0.00.00

This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.

Original Author: Marc Thurley.

bool timeBoundBroken()

Checks whether the time bound has been exceeded.

Return
true if the time bound has been exceeded.

bool start()
bool stop()

Records and saves the stop time independent of the time zone.

Return
0 for success, or -1 for failure (in which case errno is set appropriately).

double getElapsedSeconds()
bool interval_tick()
void setTimeBound(uint64_t seconds)

Updates the stopwatch’s time bound.

Parameters
  • seconds: New time bound.