# Surface Evolver Documentation

Back to top of Surface Evolver documentation. Index.

## Surface Evolver Execution Time Profiling

### Coarse Profiling

Coarse timing with resolution of 0,01 second or so can be done with Evolver's `clock` variable. For example, to time iterations I typically do

       Enter command: quiet; start := clock; g 100; print start-clock; quiet off

which will print out the elapsed time in seconds. I do `quiet` here to suppress output to the screen, which can slow down things considerably.

### Fine Profiling

Nanosecond resolution can be done with Evolver's `cpu_counter` variable.

### Expression Evaluation Profiling

On systems where Evolver has `cpu_counter` available and Evolver has been compiled with the manifest constant PROF_EVALS defined, the expression evaluator inside Evolver keeps track of the clock cycles elapsed during each expression evaluation. These expressions include procedures, functions, constraint and boundary formulas, content integrands, energy integrands, quantity integrands, etc; everything that prints out as code in a dump file. The `print profiling` command will print the accumulated CPU cycles so far for each type of expression. The times are inclusive of any child functions or procedures. An example, from mound.fe after running "gogo":

    Enter command: print profiling
    Inclusive profiling counts:
                          Name            CPU Cycles
                                  re           1,952,792
                                gogo         125,201,889
                               gogo2                   0
                               gogo3                   0
                               gogo4                   0
                               gogo5                   0

    Constraint expressions
                        Constraint  Formula Cycles   Energy Cycles  Content Cycles
                                 1         877,047       2,337,727               0

Note that hard-coded evaluations of area, volume, etc. do not show up here, except for their effect on overall elapsed time.

The command `reset_profiling` will set all the cycle values back to 0.

### Execution sampling

Of course, if you are compiling Evolver yourself, you can use any type of profiling you would ordinarily use on a C program. i leave you to your own devices on this.

Back to top of Surface Evolver documentation. Index.