Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/system/Basis/Implementation/internal-timer.sml
ViewVC logotype

Diff of /sml/trunk/system/Basis/Implementation/internal-timer.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3729, Sat Apr 21 14:21:34 2012 UTC revision 3730, Sat Apr 21 14:22:06 2012 UTC
# Line 26  Line 26 
26            unit -> (Int32.int * int * Int32.int * int * Int32.int * int) =            unit -> (Int32.int * int * Int32.int * int * Int32.int * int) =
27            CInterface.c_function "SMLNJ-Time" "gettime"            CInterface.c_function "SMLNJ-Time" "gettime"
28    
29        fun mkTime (s, us) =        fun mkTime (s, us) = Time.fromMicroseconds (1000000 * Int32.toLarge s + Int.toLarge us)
           Time.fromMicroseconds (1000000 * Int32.toLarge s + Int32.toLarge us)  
30      in      in
31      fun getTime () = let      fun getTime () = let
32          val (ts, tu, ss, su, gs, gu) = gettime' ()          val (ts, tu, ss, su, gs, gu) = gettime' ()
33      in          in {
34          { nongc = { usr = mkTime (ts, tu),            nongc = { usr = mkTime (ts, tu), sys = mkTime (ss, su) },
35                      sys = mkTime (ss, su) },            gc    = { usr = mkTime (gs, gu), sys = Time.zeroTime }
36            gc = { usr = mkTime (gs, gu),          } end
                  sys = Time.zeroTime } }  
     end  
37      end (* local *)      end (* local *)
38    
39      fun startCPUTimer () = CPUT (getTime())      fun startCPUTimer () = CPUT (getTime())

Legend:
Removed from v.3729  
changed lines
  Added in v.3730

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0