Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5ba2867ed47fdb471a18fb5f5bae808061080e90
Ticket: 1202178fffffffffffffffffffffffffffffffff
Change [time] to return a float for count>1
User & Date: das on 2005-05-19 19:47:59
Changes

  1. icomment:
    Logged In: YES 
    user_id=90580
    
    Donal, I'm not sure I understand your objection.
    For count==1, my point was that the string rep of the list that the 
    patched [time] returns is exactly the same as the stringObj currently 
    returned (constructed via sprintf).
    As long as nobody checks the Tcl_ObjType of the return value (which 
    they shouldn't), there is no way to distingush between this list and the 
    currently returned string, AFAICT
    
    I have certainly tested tclbench against this, the patch was indeed 
    primarily motivated by the desire to get more stable results from tclbench 
    for tests with small [time] results. Everything works unchanged except 
    that all timing results are now floats
    
    Don, the motivation of using an IntObj for the count==1 case was to 
    preserve the current return string format exactly when it is not necessary 
    to change it (since the measured time can never be a float for 
    count==1). I am certainly happy to always make it a float, this idea may 
    indeed be trying to be to smart for its own good...
    
    OTOH, I don't understand why you say the patch returns information 
    embodied in the Tcl_ObjType, everything would work just the same if I 
    returned just the string rep of the list I construct as a StrinObj... (except 
    that there could be truncation due to $tcl_precision)
    
    In any case, I'd even be ok to retain the current sprintf way of 
    constructing the result as long as we switch the %f.0 in the format string 
    to something with more decimals.
    
    
    
  2. login: "das"
  3. mimetype: "text/plain"
  4. username: "das"