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

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/MiscUtil/profile/profile-fn.sml
ViewVC logotype

View of /sml/trunk/src/compiler/MiscUtil/profile/profile-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 245 - (download) (annotate)
Sat Apr 17 18:47:12 1999 UTC (21 years, 5 months ago) by monnier
Original Path: sml/branches/SMLNJ/src/compiler/MiscUtil/profile/profile-fn.sml
File size: 995 byte(s)
version 110.16
(* profile-fn.sml
 *
 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
 *
 * User interface for controling profiling.
 *
 *)

functor ProfileFn (ProfEnv: PROF_ENV) : PROFILE =
  struct

    structure PC = SMLofNJ.Internals.ProfControl

    val report		= Profile.report
    val reportAll	= Profile.reportAll
    val reportData	= Profile.reportData

    val profMode : bool ref = SMLofNJ.Internals.ProfControl.profMode

    local
      val pervDone = ref false
    in
    fun doPerv() =
	  if !pervDone then ()
          else (
	    pervDone := true;
	    Control.Print.say "Creating profiled version of standard library\n";
	    ProfEnv.replace EnvRef.pervasive)
    end

    fun setProfMode true = (doPerv(); profMode := true)
      | setProfMode false = (profMode := false)
    fun getProfMode () = !profMode

    fun setTimingMode true = PC.profileOn()
      | setTimingMode false = PC.profileOff()
    val getTimingMode = PC.getTimingMode

    val reset = Profile.reset

  end;


(*
 * $Log$
 *)

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