flat assembler
Message board for the users of flat assembler.

Index > Windows > performing simple time measurements? EDIT: I got it

Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
First, I've been working on a Mandelbrot explorer for the past day or two. I used Alphonso's little graphical demo as a base for GDI drawing.


Inside the attachment are my two versions of my code. One nonthreaded, and one that I just tried making threaded.

The threaded one seems to be quite a bit faster, but any time I try to measure the codes using gettickcount(making sure to do one for each thread on the threaded one), it returns roughly the same numbers that the nonthreaded one does. That can't be right.

How would I go about timing this properly?


And please forgive me for the horrible, uncommented, unoptimized code. I just wanted it to work, and didn't care how.


EDIT: Controls are up,down,left,right,z,x,shift,control,and space. Just play around with them.


Description:
Download
Filename: mandelbrot.zip
Filesize: 10.49 KB
Downloaded: 68 Time(s)


_________________
----> * <---- My star, won HERE


Last edited by windwakr on 26 Feb 2010, 21:36; edited 1 time in total
Post 26 Feb 2010, 20:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
windwakr wrote:
... using gettickcount ...
Where is the call to GetTickCount? It doesn't appear in your source anywhere!
Post 26 Feb 2010, 21:00
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Well, I removed them. Laughing

It didn't seem to be working.

_________________
----> * <---- My star, won HERE
Post 26 Feb 2010, 21:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
So how can we point out the error if you don't post the code that was causing the problem? Confused
Post 26 Feb 2010, 21:16
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Wait a second, I forgot it's threaded. I was adding up the execution time of EACH thread.

So would it be accurate to check the time before I start the threads, and then after they're done?


Attachment on this post has what I think would be more accurate.


I'm not looking for super-accurate timing, just good enough to see the differences between threaded and not.



EDIT: Yeah, this seems about right.


Description:
Download
Filename: mandelbrot_timing.zip
Filesize: 10.59 KB
Downloaded: 64 Time(s)


_________________
----> * <---- My star, won HERE


Last edited by windwakr on 26 Feb 2010, 23:04; edited 1 time in total
Post 26 Feb 2010, 21:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
You have hardcoded your threads. What happens if you want to extend it to 8 threads? Will you make 6 more copies of the thread handling code?
Post 26 Feb 2010, 21:45
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
revolution wrote:
You have hardcoded your threads. What happens if you want to extend it to 8 threads? Will you make 6 more copies of the thread handling code?



Well, I only have a dual-core processor. If I ever get anything better, I'll rewrite the code. Plus, this was mainly made for personal use.

_________________
----> * <---- My star, won HERE
Post 26 Feb 2010, 21:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.