speed check

Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

speed check

Here is v2 of speed-test: speed check.
I fixed a lot of bugs and now speed check has a new design and a better perfomance. (and it finally works!)

An example of using:

Code: Select all

require("speedtest")
end
function love.update()
speed:start("example")
local text = ""
for i=1,1000 do
text = text.."something "
end
speed:stop("example")
end
function love.draw()
speed.draw() --draw the results
end

Now you can see the deltatime, the average time, the full time, the amount of checks and the percent of all pieces of code.

more examples: (don't forget require, speed.load() and speed.draw())

Code: Select all

function love.keypressed(key)
if key==" " then
speed.start("example")
love.timer.sleep(0.01) --here is something to check, for example sleeping for 10 ms
speed.stop("example")
end
end
or

Code: Select all

function love.load()
speed.start("example")
love.graphics.newImage("image.png") --how much time it will need to load?
speed.stop("example")
end
Maybe it can helps you for searching parts in your game/code witch are slow.

Speed check has a diagram were you can see the max deltatime in ms of 1 second and two lines, one the limit for 60FPS and one for 24FPS.
speedtest.lua
Yes I now, it is named "speedtest", but now its speed check
screenshot.png (68.66 KiB) Viewed 3832 times

functions

speed.start(name)
--start a check

speed.stop(name)
--stop a check

speed.draw()
--draw the results of all checks an the diagram

Last edited by Luke100000 on Sat Apr 26, 2014 1:42 pm, edited 8 times in total.
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: speed-test

Do you really need a library for something like this? Isn't it just two lines of code anyway?

I hope I don't sound too negative, I'm not saying that your library is bad in any way, I just question its necessity.
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

T-Bone: Yes, You can use these two lines, but in my speed-test you can see the % off all and etc. in a clear list. Soon I will show a sreenshot while I'm pressing the key.
Last edited by Luke100000 on Mon Apr 07, 2014 2:45 pm, edited 1 time in total.
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

RedHot
Citizen
Posts: 87
Joined: Mon May 27, 2013 2:43 pm
Location: Poland

Re: speed-test

Sure
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

funny... so tell me what
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: speed-test

A function to screw up results randomly.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: speed-test

It would be incredibly hard, but you could ask for a task, parse it, then compare the time the tasks take.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

raidho36 wrote:A function to screw up results randomly.
why?
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

davisdude wrote:It would be incredibly hard, but you could ask for a task, parse it, then compare the time the tasks take.
I have no idea how I can do that, sorry.

Who is online

Users browsing this forum: No registered users and 10 guests