The log and the listing file contain a number of different timing information. These information can be obtained via the Search - Menu of the GAMS IDE (or using the grep utility under UNIX).
--- Job indus89 Start 11/17/07 08:28:00 ... --- Starting execution: elapsed 0:00:00.125 ... --- Executing CPLEX: elapsed 0:00:00.688 ... --- Job indus89.gms Stop 11/17/07 08:28:04 elapsed 0:00:04.344
COMPILATION TIME = 0.094 SECONDS…: The compilation time is the time required to perform the first (compilation) pass, and is often dominated by the time required to read in large model and data files. (By default) GAMS writes an echo print of the source file possibly containing error messages, along with lists of GAMS objects, and cross reference maps to the lst file.
EXECUTION TIME = 0.547 SECONDS…: This is the time required for the second (execution) pass. Time consuming factors can be heavy numerical calculations on existing data and the use of “long” loops. Parallel assignments should be used wherever possible. The results of calculations and also execution errors (if any) are written to the lst file or othere external files.
GENERATION TIME = 0.375 SECONDS…: Time required to process a solve statement. GAMS constructs the problem at this time, and calls the solver. There are two execution times because GAMS resumes execution after the solve to read in the solution and to do any reporting etc. necessary.
S O L V E. The model attribute
model_name.resusdmakes this information available within your model. Note that this time is not included in the GAMS execution time.
One can also turn on an additional option on the command line (or in the parameter box in the upper right corner of the IDE):
At the end of the listing file you will find a section like this:
STEP SUMMARY: 0.016 0.125 STARTUP 0.000 0.062 COMPILATION 0.078 0.235 EXECUTION 0.000 0.015 CLOSEDOWN 0.094 0.437 TOTAL SECONDS 1.360 1.719 ELAPSED SECONDS 3.738 7.333 MAX HEAP SIZE (Mb)
The numbers in the right column are the aggregated times for the GAMS job. The difference between
ELAPSED SECONDS and
TOTAL SECONDS is the time consumed by the solver.
You could also program this inside the GAMS program. Create a scalar and set it at the begin of the program to
jnow (a function that reports the current time as a fraction of today's julian date):
scalar starttime; starttime = jnow;
At the end of the program do something similar:
scalar elapsed; elapsed = (jnow - starttime)*24*3600; display elapsed;
This will display the elapsed time in seconds.