1 //------------------------------------------------------------------------------
2 // GB_mx_put_time: put the time back to the global MATLAB workspace
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 #include "GB_mex.h"
11
12 double grbtime = 0, tic [2] = {0,0} ;
13
GB_mx_put_time(void)14 void GB_mx_put_time (void)
15 {
16
17 // create a MATLAB array with the right size
18 mxArray * grbresults_matlab = GB_mx_create_full (1, 2, GrB_FP64) ;
19
20 // copy the time into the MATLAB array
21 double *t = (double *) mxGetData (grbresults_matlab) ;
22
23 t [0] = grbtime ;
24 t [1] = 0 ;
25
26 grbtime = 0 ;
27
28 // put the MATLAB array into the global workspace, overwriting the
29 // version that was already there
30 mexPutVariable ("global", "GraphBLAS_results", grbresults_matlab) ;
31 }
32
33