[fpc-pascal] Happy tickets benchmark

silvioprog silvioprog at gmail.com
Sat Feb 13 13:07:31 CET 2016


On Sat, Feb 13, 2016 at 8:36 AM, Vojtěch Čihák <vojtech.cihak at atlas.cz>
wrote:

> Hi,
>
>
>
> 64-bit Linux, Core2Duo at 2GHz, FPC3.0.0:
>
>
>
> Pascal: 440 ms
>
> C:  163ms
>
> Delphi )*: 515ms
>
>
>
> )* Delphi7, personal edition, under wine, command: wine happyd7.exe
>

I think that the C code has a small problem:

Found tickets. Time elapsed: 0 msec

Just added the %d instead of %:

printf("Found %d tickets. Time elapsed: %.0f msec\n", tickets_count, msec);

Now:

gcc happytickets.c -O2 -o happytickets
./happytickets
Found 4816030 tickets. Time elapsed: 0 msec

Core i7 2.20 GHz 6 GB Windows 7 64 bits
gcc version 5.2.0 (Rev4, Built by MSYS2 project) MinGW-w64

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160213/90584b97/attachment.html>


More information about the fpc-pascal mailing list