Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function testRun()
- local a = Color3.new(0,0,0)
- local b = Color3.new(1,1,1)
- local time = tick()
- result = Color3.new(
- (b.r - a.r)*0.5 + a.r,
- (b.g - a.g)*0.5 + a.g,
- (b.b - a.b)*0.5 + a.b
- )
- local rA = tick()-time
- local time = tick()
- local c = Vector3.new(a.r,a.g,a.b):lerp(Vector3.new(b.r,b.g,b.b), 0.5)
- result = Color3.new(c.X,c.Y,c.Z)
- local rB = tick()-time
- local time = tick()
- result = a:lerp(b, 0.5)
- local rC = tick()-time
- return rA,rB,rC
- end
- local aSum,bSum,cSum = 0,0,0
- for i = 1,1000 do
- local a,b,c = testRun()
- aSum = aSum + a
- bSum = bSum + b
- cSum = cSum + c
- print(i) --Just to see progress on the 1000 iterations.
- wait()
- end
- print("Sharksie's method average time: "..aSum/1000)
- print("ScriptOn's method average time: "..bSum/1000)
- print("New Color3:Lerp method average time: "..cSum/1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement