~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/hipe/util/hipe_timing.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
%%=====================================================================
20
20
 
21
 
-spec(start/2 :: (string(), atom()) -> 'ok').
 
21
-spec start(string(), atom()) -> 'ok'.
22
22
 
23
23
start(Text, Mod) when is_atom(Mod) ->
24
24
  Timers = 
31
31
  put(hipe_timers, [Total|Timers]),
32
32
  ?msg("[@~7w]" ++ Space ++ "> ~s~n", [Total,Text]).
33
33
 
34
 
-spec(stop/2 :: (string(), atom()) -> 'ok').
 
34
-spec stop(string(), atom()) -> 'ok'.
35
35
 
36
36
stop(Text, Mod) when is_atom(Mod) ->
37
37
  {Total,_Last} = erlang:statistics(runtime),
46
46
      ?msg("[@~7w]< ~s: ~w~n", [Total, Text, Total])
47
47
  end.
48
48
 
49
 
-spec(start_optional_timer/2 :: (string(), atom()) -> 'ok').
 
49
-spec start_optional_timer(string(), atom()) -> 'ok'.
50
50
 
51
51
start_optional_timer(Text, Mod) ->
52
52
  case get(hipe_time) of 
61
61
    _ -> ok
62
62
  end.
63
63
 
64
 
-spec(stop_optional_timer/2 :: (string(), atom()) -> 'ok').
 
64
-spec stop_optional_timer(string(), atom()) -> 'ok'.
65
65
 
66
66
stop_optional_timer(Text, Mod) ->
67
67
  case get(hipe_time) of
76
76
    _ -> ok
77
77
  end.
78
78
 
79
 
-spec(start_timer/0 :: () -> non_neg_integer()).
 
79
-spec start_timer() -> non_neg_integer().
80
80
 
81
81
start_timer() ->
82
82
  {Total,_Last} = erlang:statistics(runtime),