Code Listing 2: Specification of object type to use with timers

CREATE TYPE tmr_t AS OBJECT (
   -- SHOULD BE private attributes....
   starttime      INTEGER
  ,endtime        INTEGER
  ,startcputime   INTEGER
  ,endcputime     INTEGER
  
  -- Public attributes
  ,repetitions   INTEGER
  ,NAME         VARCHAR2 (2000)
  
  ,MEMBER PROCEDURE go -- Cannot name a PL/SQL procedure START
  ,MEMBER PROCEDURE STOP (show_timing IN BOOLEAN := TRUE)
  ,MEMBER FUNCTION timing RETURN INTEGER
  ,MEMBER FUNCTION cputiming RETURN INTEGER
  ,MEMBER FUNCTION timing_desc RETURN VARCHAR2
  ,MEMBER PROCEDURE RESET (NAME IN VARCHAR2 := NULL)

   -- Replacement constructor, with different name
   ,STATIC FUNCTION make (NAME IN VARCHAR2, repetitions IN INTEGER := 1)
      RETURN tmr_t
          
   -- New in Oracle9i R2: user-defined constructor!
   ,CONSTRUCTOR FUNCTION tmr_t (
      SELF          IN OUT   tmr_t
     ,NAME          IN       VARCHAR2
     ,repetitions   IN       INTEGER
   )
      RETURN SELF AS RESULT
);