[GAP Forum] Save “time” in a variable in GAP

Alexander Hulpke hulpke at math.colostate.edu
Tue Jan 5 20:43:21 GMT 2016


> 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?

Yes, time is just like a variable (this is different to the time command in unix and other systems):

   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;

Best,

  Alexander Hulpke

-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: hulpke at math.colostate.edu, Phone: ++1-970-4914288
http://www.math.colostate.edu/~hulpke





More information about the Forum mailing list