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::getCplexTimereturns a time stamp that applications may use to calculate elapsed time in seconds.IloCplex::getDetTimereturns a time stamp in deterministic ticks.In the Java API,
IloCplex.getCplexTimereturns a time stamp that applications may use to calculate elapsed time in seconds.IloCplex.getDetTimereturns a time stamp in deterministic ticks.In the .NET API, the property
Cplex.CplexTimeaccesses a time stamp that applications may use to calculate elapsed time in seconds. The propertyCplex.DetTimeaccesses a time stamp in deterministic ticks.
In the Callable Library,
CPXXgettimereturns a time stamp that applications may use to calculate elapsed time in seconds.CPXXgetdettimereturns 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.cppin C++ in Concert TechnologyMIPex4.javain Java in Concert TechnologyMIPex4.csin C#.NET in Concert TechnologyMIPex4.vbin Visual Basic.NET in Concert Technologyxmipex4.cin C in the Callable Library