generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: What's the smallest amount of time you can wait

Previous Thread :: Next Thread 
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
21 May 2014 12:03 PM
without it being = to wait()

Like, how small can I get before it's the same amount of time as wait()

#Piano
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
21 May 2014 12:05 PM
game:service'RunService'.RenderStepped:connect(function()

end)

http://wiki.roblox.com/index.php?title=RenderStepped_(Event)

Report Abuse
pickupthemail is not online. pickupthemail
Joined: 07 Nov 2013
Total Posts: 55
21 May 2014 12:05 PM
uh, I think you can do this, although it might just be waiting 0.043546 seconds or w/e

wait(0)

also, you can do this

w = wait()
a = w
print(a)
Report Abuse
pickupthemail is not online. pickupthemail
Joined: 07 Nov 2013
Total Posts: 55
21 May 2014 12:05 PM
@Ver

forgot about renderstepped, dang your ninja..q.q
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
21 May 2014 12:19 PM
local Laps = {}
for x = 1, 1000, 1 do
local WAIT = wait()
table.insert(Laps, WAIT)
end
local Total = 0
for _, x in pairs (Laps) do
Total = Total + x
end
print("Average: " .. tostring(Total / #Laps))
print("Fastest: " .. tostring(math.min(unpack(Laps))))


wait()
Average: 0.034172162818505
Fastest: 0.032403380127789

wait(0)
Average: 0.034206922808097
Fastest: 0.032972001426458

wait(0.03)
Average: 0.034107806849076
Fastest: 0.033682554886013

wait(1/30)
Average: 0.034540824911504
Fastest: 0.033409848752967





local Laps = {}
local Last = tick()
local Loop = 1
Connect = Game:GetService("RunService").Stepped:connect(function()
table.insert(Laps, (tick() - Last))
Last = tick()
if Loop == 100 then
Connect:disconnect()
else
Loop = Loop + 1
end
end)
repeat
wait()
until #Laps == 100

local Total = 0
for _, x in pairs (Laps) do
Total = Total + x
end
print("Average: " .. tostring(Total / #Laps))
print("Fastest: " .. tostring(math.min(unpack(Laps))))

RunService
Average: 0.033897471427917
Fastest: 0.0014431476593018
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
21 May 2014 12:23 PM
I redid the run service one with 1,000 laps instead of only 100 (Because I meant to do 1,000)

Average: 0.034140079498291
Fastest: 0.017651081085205
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image