[Gambas-user] if-else vs try who are best faster in machine time?

Jussi Lahtinen jussi.lahtinen at ...626...
Tue Nov 5 02:37:02 CET 2013


> > Why not simply write benchmark?
> >
>
> A benchmark wouldn't be accurate, as it will be IO bound,


!?
Just repeat the commands couple thousand times with either case (file exist
and file doesn't exist) and take the mean time for comparison. If the
accuracy isn't enough to see the difference in benchmark, then why there
would be difference in practice?



> Besides, first option can fail if
> you don't have write access to the file, thus needing a third access to
> check for permission to delete.


I agree that would change the question, but so far it seem to be unfounded
assumption.


Jussi



More information about the User mailing list