Timeline for Calculate the number of primes up to n
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 4, 2016 at 13:16 | history | edited | Tamoghna Chowdhury | CC BY-SA 3.0 | edited body |
| Mar 3, 2016 at 23:43 | history | edited | Liam | CC BY-SA 3.0 | added 26 characters in body |
| Mar 3, 2016 at 20:15 | comment | added | Addison Crump | @TamoghnaChowdhury You are restricted to the language builtins. :P As far as I can see, nanoTime(), though occasionally inaccurate, is the best solution you can have. | |
| Mar 3, 2016 at 10:19 | comment | added | Tamoghna Chowdhury | @CoolestVeto in my experience, if you are calculating a time difference, it's fine. I have timed many of my programs using nanoTime, and if not accurate, it's at least consistent. Also, currentTimeMillis() I tried, but it didn't give me the desired resolution for some of the faster cases. What do you suggest? | |
| Mar 3, 2016 at 9:32 | comment | added | Addison Crump | @TamoghnaChowdhury Isn't nanoTime() seriously inaccurate? | |
| Mar 3, 2016 at 3:55 | comment | added | Tamoghna Chowdhury | @Liam thanks. BTW, this is the only (partially) multithreaded answer. I expect you understand Java natively? | |
| Mar 3, 2016 at 3:53 | comment | added | Liam | Of course I will. I'll be doing it tomorrow. If I have trouble I'll ping you in chat | |
| Mar 3, 2016 at 3:51 | comment | added | Tamoghna Chowdhury | @Liam I guess you'll have to make an exception in my case, then. You could tweak the main method for command line arguments, but the program is self-timing anyway. Check it out anyway. Please? | |
| Mar 2, 2016 at 23:13 | comment | added | Liam | Also for timing, I've been sending stdout to /dev/null | |
| Mar 2, 2016 at 14:43 | history | edited | Tamoghna Chowdhury | CC BY-SA 3.0 | edited body |
| Mar 2, 2016 at 13:25 | history | edited | Tamoghna Chowdhury | CC BY-SA 3.0 | added 1636 characters in body |
| Mar 2, 2016 at 13:17 | history | edited | Tamoghna Chowdhury | CC BY-SA 3.0 | added 1636 characters in body |
| Mar 2, 2016 at 11:41 | comment | added | Tamoghna Chowdhury | @zyabin101 , if anybody had the patience to go through the code, he/she would understand that STDOUT latency has been accounted for. | |
| Mar 2, 2016 at 11:39 | comment | added | user48538 | Outputting only the result of pi(n) (with no prompts) may save some time, because STDOUT is... well, let's say it could just be a bit faster. | |
| Mar 2, 2016 at 11:36 | history | answered | Tamoghna Chowdhury | CC BY-SA 3.0 |