Fwd: [Squeak-fr] durationToRun

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

Fwd: [Squeak-fr] durationToRun

Stéphane Ducasse


Begin forwarded message:

> From: Stéphane Rollandin <[hidden email]>
> Date: June 15, 2009 9:32:54 AM CEDT
> To: Squeak in french / Squeak en français <[hidden email]
> >
> Subject: Re: [Squeak-fr] durationToRun
> Reply-To: Squeak in french / Squeak en français <[hidden email]
> >
>
> [3500 milliSeconds asDelay wait] durationToRun
>
> donne 0:00:00:00.3501 sur Squeak3.10.2, mais donne le format correct  
> 0:00:00:03.5 sur Squeak3.8.2.
>
> le problème vient de
>
> Duration class>>
> days: days hours: hours minutes: minutes seconds: seconds  
> nanoSeconds: nanos
>
> ^ self seconds: ((days * SecondsInDay)
> + (hours * SecondsInHour)
> + (minutes * SecondsInMinute)
> + seconds)
> nanoSeconds: nanos
>
>
> ... qui est faux, car les nanoseconds ne participent pas au calcul  
> des seconds.
>
> la version précédente est:
>
> days: days hours: hours minutes: minutes seconds: seconds  
> nanoSeconds: nanos
>
> ^ self nanoSeconds:
> ( ( (days * SecondsInDay)
> + (hours * SecondsInHour)
> + (minutes * SecondsInMinute)
> + seconds ) * NanosInSecond )
> + nanos.
>
>
> et là ça marche.
>
> Stef
>
>
> _______________________________________________
> Squeak-fr mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/squeak-fr
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Squeak-fr] durationToRun

Nicolas Cellier
Sauf si la nouvelle version de Duration prend garde d'avoir nanos <
NanosInSecond
Ce qu'elle fait dans certains messages de création mais pas dans tous.

Unless new version of Duration takes care to assert nanos < NanosInSecond
Which is done in some instance creation messages but not all...

I guess the reason of the changes were to avoid LargeInteger
operations and gain some efficiency.
It might not be the best idea to revert to a slow implementation.
We should better correct instance creation to always assert nanos <
NanosInSecond.

Nicolas

Le 15 juin 2009 10:06, Stéphane Ducasse<[hidden email]> a écrit :

>
>
> Begin forwarded message:
>
>> From: Stéphane Rollandin <[hidden email]>
>> Date: June 15, 2009 9:32:54 AM CEDT
>> To: Squeak in french / Squeak en français <[hidden email]
>> >
>> Subject: Re: [Squeak-fr] durationToRun
>> Reply-To: Squeak in french / Squeak en français <[hidden email]
>> >
>>
>> [3500 milliSeconds asDelay wait] durationToRun
>>
>> donne 0:00:00:00.3501 sur Squeak3.10.2, mais donne le format correct
>> 0:00:00:03.5 sur Squeak3.8.2.
>>
>> le problème vient de
>>
>> Duration class>>
>> days: days hours: hours minutes: minutes seconds: seconds
>> nanoSeconds: nanos
>>
>>       ^ self seconds: ((days * SecondsInDay)
>>       + (hours * SecondsInHour)
>>       + (minutes * SecondsInMinute)
>>       + seconds)
>>               nanoSeconds: nanos
>>
>>
>> ... qui est faux, car les nanoseconds ne participent pas au calcul
>> des seconds.
>>
>> la version précédente est:
>>
>> days: days hours: hours minutes: minutes seconds: seconds
>> nanoSeconds: nanos
>>
>>       ^ self nanoSeconds:
>>       ( ( (days * SecondsInDay)
>>       + (hours * SecondsInHour)
>>       + (minutes * SecondsInMinute)
>>       + seconds ) * NanosInSecond )
>>       + nanos.
>>
>>
>> et là ça marche.
>>
>> Stef
>>
>>
>> _______________________________________________
>> Squeak-fr mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/squeak-fr
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [Squeak-fr] durationToRun

Stéphane Ducasse
Tx!

Stef

On Jun 15, 2009, at 10:43 AM, Nicolas Cellier wrote:

> Sauf si la nouvelle version de Duration prend garde d'avoir nanos <
> NanosInSecond
> Ce qu'elle fait dans certains messages de création mais pas dans tous.
>
> Unless new version of Duration takes care to assert nanos <  
> NanosInSecond
> Which is done in some instance creation messages but not all...
>
> I guess the reason of the changes were to avoid LargeInteger
> operations and gain some efficiency.
> It might not be the best idea to revert to a slow implementation.
> We should better correct instance creation to always assert nanos <
> NanosInSecond.
>
> Nicolas
>
> Le 15 juin 2009 10:06, Stéphane Ducasse<[hidden email]> a  
> écrit :
>>
>>
>> Begin forwarded message:
>>
>>> From: Stéphane Rollandin <[hidden email]>
>>> Date: June 15, 2009 9:32:54 AM CEDT
>>> To: Squeak in french / Squeak en français <[hidden email]
>>>>
>>> Subject: Re: [Squeak-fr] durationToRun
>>> Reply-To: Squeak in french / Squeak en français <[hidden email]
>>>>
>>>
>>> [3500 milliSeconds asDelay wait] durationToRun
>>>
>>> donne 0:00:00:00.3501 sur Squeak3.10.2, mais donne le format correct
>>> 0:00:00:03.5 sur Squeak3.8.2.
>>>
>>> le problème vient de
>>>
>>> Duration class>>
>>> days: days hours: hours minutes: minutes seconds: seconds
>>> nanoSeconds: nanos
>>>
>>>       ^ self seconds: ((days * SecondsInDay)
>>>       + (hours * SecondsInHour)
>>>       + (minutes * SecondsInMinute)
>>>       + seconds)
>>>               nanoSeconds: nanos
>>>
>>>
>>> ... qui est faux, car les nanoseconds ne participent pas au calcul
>>> des seconds.
>>>
>>> la version précédente est:
>>>
>>> days: days hours: hours minutes: minutes seconds: seconds
>>> nanoSeconds: nanos
>>>
>>>       ^ self nanoSeconds:
>>>       ( ( (days * SecondsInDay)
>>>       + (hours * SecondsInHour)
>>>       + (minutes * SecondsInMinute)
>>>       + seconds ) * NanosInSecond )
>>>       + nanos.
>>>
>>>
>>> et là ça marche.
>>>
>>> Stef
>>>
>>>
>>> _______________________________________________
>>> Squeak-fr mailing list
>>> [hidden email]
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/squeak-fr
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project