Using the timing interface

Describes the timing interface for accessing general purpose time stamps.

There are methods and routines in IBM ILOG CPLEX that provide a time stamp to enable you to measure computational time. These methods and routines are adapted for use either with opportunistic search or with the default deterministic search. Some of the methods and routines measure time in seconds of wall-clock time; others measure time in deterministic ticks. An application can invoke one of these methods or routines at the beginning and end of an operation, and then compare the two time stamps to compute elapsed time (either in seconds or in deterministic ticks, depending on the respective method or routine that you chose).

  • In Concert Technology

    • In the C++ API, IloCplex::getCplexTime returns a time stamp that applications may use to calculate elapsed time in seconds. IloCplex::getDetTime returns a time stamp in deterministic ticks.

    • In the Java API, IloCplex.getCplexTime returns a time stamp that applications may use to calculate elapsed time in seconds. IloCplex.getDetTime returns a time stamp in deterministic ticks.

    • In the .NET API, the property Cplex.CplexTime accesses a time stamp that applications may use to calculate elapsed time in seconds. The property Cplex.DetTime accesses a time stamp in deterministic ticks.

  • In the Callable Library, CPXXgettime returns a time stamp that applications may use to calculate elapsed time in seconds. CPXXgetdettime returns a time stamp in deterministic ticks.

  • In the Python API, the method Cplex.get_time returns a time stamp to measure elapsed time in seconds, and the method Cplex.get_dettime returns a time stamp to measure elapsed time in deterministic ticks.

Timestamps for callbacks

In addition, other methods and routines return a time stamp adapted to use in callbacks. Again, there are methods and routines available either for measuring time in seconds or for measuring time in deterministic ticks. For more information about these callback methods and routines, see Using the timing interface in callbacks.

Examples of the timing interface

For a sample of these timing features, see these examples among those distributed with the product in yourCPLEXinstallation/examples:

  • ilomipex4.cpp in C++ in Concert Technology

  • MIPex4.java in Java in Concert Technology

  • MIPex4.cs in C#.NET in Concert Technology

  • MIPex4.vb in Visual Basic.NET in Concert Technology

  • xmipex4.c in C in the Callable Library