Save "time" in a variable in GAP

77 Views Asked by At

i'm trying to write a program in GAP to obtain the time that GAP needs to construct the groups of an order given. I'm using the command:

ConstructAllGroups(order);;time;

Is there anyway to save the value of "time" in a variable? I did it with:

a:=ConstructAllGroups(10);;time;

but only the groups were saved.

1

There are 1 best solutions below

1
On BEST ANSWER

Time is just like a variable (this is different to the time command in unix and other systems), so you can assign its value to other variables:

a:=ConstructAllGroups(10);;savedtime:=time;

Within a program I would rather refer to the value of Runtime(), that is:

start:=Runtime();
a:=ConstructAllPiffles(-33);
total:=Runtime()-start;

(community wiki so that a web search finds an answer)