The Trunk: Chronology-Core-nice.44.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Chronology-Core-nice.44.mcz

commits-2
Nicolas Cellier uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-nice.44.mcz

==================== Summary ====================

Name: Chronology-Core-nice.44
Author: nice
Time: 6 May 2019, 9:25:01.091073 am
UUID: aec07289-9959-4dcf-b422-3079111e5ed3
Ancestors: Chronology-Core-nice.43

Fixup: use highResClock provided by self (Time) rather than Smalltalk (which is a dependency of AndreasSystemProfiler)

=============== Diff against Chronology-Core-nice.43 ===============

Item was changed:
  ----- Method: Time class>>estimateHighResClockTicksPerMillisecond (in category 'clock') -----
  estimateHighResClockTicksPerMillisecond
 
  | t0 t1 t2 t3 |
 
  "Count the ticks ellapsed during a 10ms busy loop"
  t0 := Time utcMicrosecondClock + 200.
  [Time utcMicrosecondClock >= t0] whileFalse.
+ t1 := self highResClock.
- t1 := Smalltalk highResClock.
  [Time utcMicrosecondClock >= (t0 + 10000)] whileFalse.
+ t1 := self highResClock - t1 * 1000 // (Time utcMicrosecondClock - t0).
- t1 := Smalltalk highResClock - t1 * 1000 // (Time utcMicrosecondClock - t0).
 
  "Count the ticks ellapsed during a 20ms busy loop"
  t0 := Time utcMicrosecondClock + 200.
  [Time utcMicrosecondClock >= t0] whileFalse.
+ t2 := self highResClock.
- t2 := Smalltalk highResClock.
  [Time utcMicrosecondClock >= (t0 + 20000)] whileFalse.
+ t2 := self highResClock - t2 * 1000 // (Time utcMicrosecondClock - t0).
- t2 := Smalltalk highResClock - t2 * 1000 // (Time utcMicrosecondClock - t0).
 
  "Count the ticks ellapsed during a 30ms busy loop"
  t0 := Time utcMicrosecondClock + 200.
  [Time utcMicrosecondClock >= t0] whileFalse.
+ t3 := self highResClock.
- t3 := Smalltalk highResClock.
  [Time utcMicrosecondClock >= (t0 + 30000)] whileFalse.
+ t3 := self highResClock - t3 * 1000 // (Time utcMicrosecondClock - t0).
- t3 := Smalltalk highResClock - t3 * 1000 // (Time utcMicrosecondClock - t0).
 
  "Take the median of the 3 estimates as the best"
  ^ t1 <= t2
  ifTrue: [t2 <= t3
  ifTrue: [t2]
  ifFalse: [t1 <= t3
  ifTrue: [t3]
  ifFalse: [t1]]]
  ifFalse: [t1 <= t3
  ifTrue: [t1]
  ifFalse: [t2 <= t3
  ifTrue: [t3]
  ifFalse: [t2]]]!