Jump to content

Time problem in the script


 Share

Recommended Posts

#Include <Date.au3>
Func Fool()
For $i = 1 to 1
    Send("i am a fool" & @CRLF)
Next
EndFunc
Opt("WinTitleMatchMode", 2)
$Start = TimerInit()
For $1 = 1 to 100
    WinWaitActive("Please type 'i am a fool' for 100 times.", "")
    Fool()
Next
$Total_Time = TimerDiff($Start)
MsgBox(64, "Typing Done", "Total time passed: " & _DateTimeFormat($Total_Time, 3))

at the end of script i can't see the passed time. what is the problem in it?

Thanks

Edited by UltraFine
Link to comment
Share on other sites

#Include <Date.au3>
Func Fool()
For $i = 1 to 1
    Send("i am a fool" & @CRLF)
Next
EndFunc
Opt("WinTitleMatchMode", 2)
$Start = TimerInit()
For $1 = 1 to 100
    WinWaitActive("Please type 'i am a fool' for 100 times.", "")
    Fool()
Next
$Total_Time = TimerDiff($Start)
MsgBox(64, "Typing Done", "Total time passed: " & _DateTimeFormat($Total_Time, 3))

at the end of script i can't see the passed time. what is the problem in it?

Thanks

Once again, read your help file entry for each function you are using.

Then re-read about the TimerDiff() return value, and _DateTimeFormat() input value to see if they match.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Up

Change can be a bit slow but it's not that change can happen, it's more that change cannot be stopped.

Did you follow up PsaltyDS' suggestion?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Up

You started out doing the right thing here: You posted a short script that demonstrated the problem you wanted help with.

Then you were told exactly where to look for the solution.

With no indication of any effort or thought about the answer you already got, you now want to bump the topic...?

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You started out doing the right thing here: You posted a short script that demonstrated the problem you wanted help with.

Then you were told exactly where to look for the solution.

With no indication of any effort or thought about the answer you already got, you now want to bump the topic...?

:mellow:

Just tell me, what i am doing wrong in my script?
Link to comment
Share on other sites

Just tell me, what i am doing wrong in my script?

See Post #2, then post what you found when you looked those functions up.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

i have read but still can't understand. if you will tell me that what is problem in my script than it would be good. it is not giving any error... but not showing the time.

He's saying that the format of the return from TimerDiff() can't be used with _DateTimeFormat().

Take a look at the example in _TicksToTime().

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...