Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetTickCount
#1
I was wondering if there was a tut with a good explanation of using GetTickCount. If so could someone point me in the direction,

Thanks.
Reply
#2
Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed

'CODE GOES HERE ROFL

nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
so that would work for replacing timers?
Reply
#4
Oh yeah! Completely!

I mean, it doesn't matter what the timers are doing!

This one piece of code will manage to replace all the timers in the game!

Wooooooooh!
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
so key this
Code:
dim currenttick, nexttick, elapsed as long 'variables we are using

currenttick = gettickcount 'currenttick is now saved as the time this line was executed
before anything that you want to use GetTickCount and
Code:
nexttick = gettickcount 'same as above

elapsed = nexttick - currenttick 'the elapsed time is the time recorded after the code minus the time recorded before the code
at the end of the code?
Reply
#6
I gave you just a small example of how to use gettickcount.

My example showed a quick calculation to see how long it takes for a piece of code to finish.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#7
What?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
Verrigan Wrote:What part didn't you understand? Tongue

The fact that nobody said anything about that in this post? xD
Reply
#9
Verrigan Wrote:I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. Sad

Don't cry now. Lol.

It's okay. Everything will be fine.
Reply
#10
I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#11
Robin Wrote:I thought it was a joke, but my technical wittiness, whilst quite powerful, is nothing compared to yours.


Haha, you're an ass dude.
Reply
#12
Verrigan Wrote:I was just trying to figure out why it was in Advanced Questions rather than Beginner Questions, where it should have been.. So I made a guess, and tried to make a light joke out of it, and I guess nobody got it. Sad

actually i drew assumptions and understood it... i just didnt want to post incase i looked like an idiot ;D
Reply
#13
rofl, I didnt get it at all :lol:

I searched high and low, but couldnt find it. I even used the search Tongue
Reply
#14
Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?
Reply
#15
DarkX Wrote:Ok I got everything working now, accept I can't get the equipped items to blit at all. any suggestions?

scream and roll on the floor? ^_^

honestly.. what do you mean cant get them to blt? blt where? maybe your blt'd them into the recycle bin?

I dont understand.. i thought this was about gettickcount o.0
Reply
#16
Except.
Blt.

Check your spelling next time.

As to what you're on about, maybe you should read the topic title before posting ^_^
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#17
Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^
Reply
#18
We only assume it's pronounced blit.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#19
Same difference. I feel like an idiot when I say blt though. Makes me want a sammich. O_o
Reply
#20
Perfekt Wrote:Didn't he start the topic? O_o (Too lazy to check. xD)

And Blt is only the term used in the programming. It would be spelled Blit. ^_^

Yes I did start the topic, and it is about TickCount which I thank Robin for the code. By the way the Blit thing, I was rewriting GSD's Visual Inventory code to use GetTickCount, and I think somewhere along the lines I messed up the blit code for the equipped. But thanks for the assistance from all ya.
Reply
#21
It already uses gettickcount...
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#22
Code:
double click the timer in frmMirage (the one u made) add the following:

Dim Q As Integer

On Error Resume Next
For Q = 0 To MAX_INV - 1
If PicInv(Q).Picture  LoadPicture() Then
PicInv(Q).Picture = LoadPicture()
Else
Call BitBlt(PicInv(Q).hdc, 0, 0, PIC_X, PIC_Y, PicItems.hdc, 0,
Item(GetPlayerInvItemNum(MyIndex, lstInv.SelCount + Q)).Pic * PIC_Y,
SRCCOPY)
End If
Next Q
that's a line from the code, does that not mean that it uses a timer?
Reply
#23
Hmph. I guess I converted it to GetTickCount myself...
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#24
Robin Wrote:Hmph. I guess I converted it to GetTickCount myself...

xD

Don't you feel like a heel now? Haha.
Reply
#25
Not really.

I guessed the tutorial used gettickcount.

Anyway, I've given him the basic knowledge of gettickcount, he can now go use it on that code himself ^_^
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)