## Name:

time procedure for timing Sollya code.

## Usage:

time(code) : code -> constant

## Parameters:

• code is the code to be timed.

## Description:

• time permits timing a Sollya instruction, resp. a begin-end block of Sollya instructions. The timing value, measured in seconds, is returned as a Sollya constant (and not merely displayed as for timing). This permits performing computations of the timing measurement value inside Sollya.
• The extended nop command permits executing a defined number of useless instructions. Taking the ratio of the time needed to execute a certain Sollya instruction and the time for executing a nop therefore gives a way to abstract from the speed of a particular machine when evaluating an algorithm's performance.

## Example 1:

> t = time(p=remez(sin(x),10,[-1;1]));
> write(t,"s were spent computing p = ",p,"\n");
4.3581453999999999999999999999999999999318398346354e-2s were spent computing p = 9.0486898749977990986908851357759191711354777014602e-17 * x^10 + 2.68762595115123596299959320959141640012683406736586e-6 * x^9 + -2.4247978492521313349073232289246205727856268698001e-16 * x^8 + -1.98344863020965929701245606503586461226130937598776e-4 * x^7 + 2.2748214757753544349162426281857910162575492126267e-16 * x^6 + 8.3333037186560980567697821420813799547276481409702e-3 * x^5 + -8.574715198972066974170696130354953131211051121887e-17 * x^4 + -0.166666661386013237076216566493953847771564552744173 * x^3 + 1.05699558969863875841493332282097022580493449058156e-17 * x^2 + 0.99999999973628365676559825181776417246038944720795 * x + (-3.1206530956601883024316320853642604562810646600878e-19)

## Example 2:

> write(time({ p=remez(sin(x),10,[-1;1]); write("The error is 2^(", log2(dirtyinfnorm(p-sin(x),[-1;1])), ")\n"); }), "s were spent\n");
The error is 2^(log2(2.39601979446524486606649528289933482070294808074097e-11))
7.2049493999999999999999999999999999997972850399973e-2s were spent

## Example 3:

> t = time(bashexecute("sleep 10"));