Skip to content

Commit

Permalink
Merge pull request #596 from zickgraf/master
Browse files Browse the repository at this point in the history
Introduce CallFuncListWithUserTime
  • Loading branch information
mohamed-barakat authored Oct 9, 2023
2 parents 0f10537 + 4a7ac0b commit 3468c04
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ToolsForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "ToolsForHomalg",
Subtitle := "Special methods and knowledge propagation tools",
Version := "2023.07-01",
Version := "2023.10-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
1 change: 1 addition & 0 deletions ToolsForHomalg/gap/ToolsForHomalg.gd
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ DeclareOperation( "ShaSum",
DeclareGlobalFunction( "GetTimeOfDay" );

DeclareGlobalFunction( "CallFuncListWithTime" );
DeclareGlobalFunction( "CallFuncListWithUserTime" );

#! @Description
#! returns a new list that contains for each element <A>elm</A> of the list <A>list</A> a list of length two,
Expand Down
23 changes: 23 additions & 0 deletions ToolsForHomalg/gap/ToolsForHomalg.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,29 @@ InstallGlobalFunction( CallFuncListWithTime,

end );

##
InstallGlobalFunction( CallFuncListWithUserTime,
function( func, arguments )
local output, t0, t1;

if not IsList( arguments ) then

return CallFuncListWithUserTime( func, [ arguments ] );

fi;

t0 := Runtime( );

output := CallFuncList( func, arguments );

t1 := Runtime( );

Print( t1 - t0, " ms\n" );

return output;

end );

##
InstallGlobalFunction( CollectEntries,
function( list )
Expand Down

0 comments on commit 3468c04

Please sign in to comment.