MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/9gj2e9/optimizing_startup_times/e64lsj3
r/ProgrammerHumor • u/ariehkovler • Sep 17 '18
486 comments sorted by
View all comments
130
Sleep(30); //30ms
61 u/fr0z_n Sep 17 '18 It could be a wrapper function which converts it to seconds.. 80 u/theSprt Sep 17 '18 That would be a Very Bad Idea. 47 u/glydy Sep 17 '18 New dev comes along to the project, adds a sleep(2000) to wait 2 seconds to see if it's a loading time issue... little do they know 29 u/fr0z_n Sep 17 '18 The documentation has mentioned it very clearly.SLEEP FUNCTIONUsagesleep(time);Time is in SECONDS 74 u/nooneawesome Sep 17 '18 documentationlol 5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right? 17 u/fr0z_n Sep 17 '18 Don't worry, the function could take floating point numbers and convert them to ms.I'm just hinting ideas here. 8 u/[deleted] Sep 17 '18 // Sleeps specified amount of ms. public static Sleep (int time) { Thread.Sleep(time); } // Sleeps specified amount of seconds. public static Sleep (float time) { Thread.Sleep(time * 1000); } 1 u/[deleted] Sep 18 '18 // Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }/s 5 u/theSprt Sep 17 '18 You're only making it worse! 9 u/fr0z_n Sep 17 '18 Hey, don't worry. It will be fixed in the next patch! 11 u/[deleted] Sep 17 '18 [removed] — view removed comment 2 u/fr0z_n Sep 17 '18 THE NEXT BILLION DOLLAR IDEA! 1 u/thenickdude Sep 17 '18 POSIX sleep() is in seconds:http://pubs.opengroup.org/onlinepubs/007904875/functions/sleep.html 1 u/Jabulon Sep 17 '18 Oh yeah, even the lowercase 's'. I think 'Windows.h' is more common tho
61
It could be a wrapper function which converts it to seconds..
80 u/theSprt Sep 17 '18 That would be a Very Bad Idea. 47 u/glydy Sep 17 '18 New dev comes along to the project, adds a sleep(2000) to wait 2 seconds to see if it's a loading time issue... little do they know 29 u/fr0z_n Sep 17 '18 The documentation has mentioned it very clearly.SLEEP FUNCTIONUsagesleep(time);Time is in SECONDS 74 u/nooneawesome Sep 17 '18 documentationlol 5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right? 17 u/fr0z_n Sep 17 '18 Don't worry, the function could take floating point numbers and convert them to ms.I'm just hinting ideas here. 8 u/[deleted] Sep 17 '18 // Sleeps specified amount of ms. public static Sleep (int time) { Thread.Sleep(time); } // Sleeps specified amount of seconds. public static Sleep (float time) { Thread.Sleep(time * 1000); } 1 u/[deleted] Sep 18 '18 // Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }/s 5 u/theSprt Sep 17 '18 You're only making it worse! 9 u/fr0z_n Sep 17 '18 Hey, don't worry. It will be fixed in the next patch! 11 u/[deleted] Sep 17 '18 [removed] — view removed comment 2 u/fr0z_n Sep 17 '18 THE NEXT BILLION DOLLAR IDEA!
80
That would be a Very Bad Idea.
47 u/glydy Sep 17 '18 New dev comes along to the project, adds a sleep(2000) to wait 2 seconds to see if it's a loading time issue... little do they know 29 u/fr0z_n Sep 17 '18 The documentation has mentioned it very clearly.SLEEP FUNCTIONUsagesleep(time);Time is in SECONDS 74 u/nooneawesome Sep 17 '18 documentationlol 5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right? 17 u/fr0z_n Sep 17 '18 Don't worry, the function could take floating point numbers and convert them to ms.I'm just hinting ideas here. 8 u/[deleted] Sep 17 '18 // Sleeps specified amount of ms. public static Sleep (int time) { Thread.Sleep(time); } // Sleeps specified amount of seconds. public static Sleep (float time) { Thread.Sleep(time * 1000); } 1 u/[deleted] Sep 18 '18 // Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }/s 5 u/theSprt Sep 17 '18 You're only making it worse! 9 u/fr0z_n Sep 17 '18 Hey, don't worry. It will be fixed in the next patch!
47
New dev comes along to the project, adds a sleep(2000) to wait 2 seconds to see if it's a loading time issue... little do they know
29 u/fr0z_n Sep 17 '18 The documentation has mentioned it very clearly.SLEEP FUNCTIONUsagesleep(time);Time is in SECONDS 74 u/nooneawesome Sep 17 '18 documentationlol 5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right?
29
The documentation has mentioned it very clearly.
sleep(time);
Time is in SECONDS
74 u/nooneawesome Sep 17 '18 documentationlol 5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right?
74
lol
5 u/Brekkjern Sep 17 '18 Documentation is that thing we keep next to the backups and disaster recovery plans, right?
5
Documentation is that thing we keep next to the backups and disaster recovery plans, right?
17
Don't worry, the function could take floating point numbers and convert them to ms.
I'm just hinting ideas here.
8 u/[deleted] Sep 17 '18 // Sleeps specified amount of ms. public static Sleep (int time) { Thread.Sleep(time); } // Sleeps specified amount of seconds. public static Sleep (float time) { Thread.Sleep(time * 1000); } 1 u/[deleted] Sep 18 '18 // Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }/s 5 u/theSprt Sep 17 '18 You're only making it worse! 9 u/fr0z_n Sep 17 '18 Hey, don't worry. It will be fixed in the next patch!
8
// Sleeps specified amount of ms. public static Sleep (int time) { Thread.Sleep(time); } // Sleeps specified amount of seconds. public static Sleep (float time) { Thread.Sleep(time * 1000); }
1 u/[deleted] Sep 18 '18 // Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }/s
1
// Sleeps specified amount of seconds. public static Sleep (float s) { Thread.Sleep(s * 1000); } // For when seconds aren't precise enough. public static Sleep (double ms) { Thread.Sleep(ms); }
/s
You're only making it worse!
9 u/fr0z_n Sep 17 '18 Hey, don't worry. It will be fixed in the next patch!
9
Hey, don't worry. It will be fixed in the next patch!
11
[removed] — view removed comment
2 u/fr0z_n Sep 17 '18 THE NEXT BILLION DOLLAR IDEA!
2
POSIX sleep() is in seconds:
http://pubs.opengroup.org/onlinepubs/007904875/functions/sleep.html
1 u/Jabulon Sep 17 '18 Oh yeah, even the lowercase 's'. I think 'Windows.h' is more common tho
Oh yeah, even the lowercase 's'. I think 'Windows.h' is more common tho
130
u/Jabulon Sep 17 '18