equal
deleted
inserted
replaced
32 return counter / freq; |
32 return counter / freq; |
33 } |
33 } |
34 |
34 |
35 double TimeHelper::counter_to_millis(jlong counter) { |
35 double TimeHelper::counter_to_millis(jlong counter) { |
36 return counter_to_seconds(counter) * 1000.0; |
36 return counter_to_seconds(counter) * 1000.0; |
|
37 } |
|
38 |
|
39 elapsedTimer::elapsedTimer(jlong time, jlong timeUnitsPerSecond) { |
|
40 _active = false; |
|
41 jlong osTimeUnitsPerSecond = os::elapsed_frequency(); |
|
42 assert(osTimeUnitsPerSecond % 1000 == 0, "must be"); |
|
43 assert(timeUnitsPerSecond % 1000 == 0, "must be"); |
|
44 while (osTimeUnitsPerSecond < timeUnitsPerSecond) { |
|
45 timeUnitsPerSecond /= 1000; |
|
46 time *= 1000; |
|
47 } |
|
48 while (osTimeUnitsPerSecond > timeUnitsPerSecond) { |
|
49 timeUnitsPerSecond *= 1000; |
|
50 time /= 1000; |
|
51 } |
|
52 _counter = time; |
37 } |
53 } |
38 |
54 |
39 void elapsedTimer::add(elapsedTimer t) { |
55 void elapsedTimer::add(elapsedTimer t) { |
40 _counter += t._counter; |
56 _counter += t._counter; |
41 } |
57 } |