Jump to content

Variables and INI files


DCCD
 Share

Recommended Posts

As you can see, there's $var1 in my scr.au3 and the same in .INI file, both works but which one is faster, I bet on the one inside .au3 file!. So i tried to get the ini var delay in milliseconds "See Example Below", but there's no delay! So i need your help to know which one is faster in milliseconds.

.au3

$var1 = "create and assign"

.ini

[1]
var1=create and assign

get the delay in milliseconds.

IniWrite(@ScriptDir&"\myfile.ini", "section2", "key", @ComputerName)
;
;
$start=@MSEC
$var = IniRead(@ScriptDir&"\myfile.ini", "section2", "key", "NotFound")
$End=@MSEC
MsgBox(4096, "Result", 'Start: '&$start&'ms '&@CRLF&'End: '&$End&'ms'&@CRLF&@CRLF&'key='&$var)
Link to comment
Share on other sites

Use something like:

IniWrite(@ScriptDir & "\myfile.ini", "section2", "key", @ComputerName)
$start = TimerInit()
$var = IniRead(@ScriptDir & "\myfile.ini", "section2", "key", "NotFound")
$Duration = TimerDiff($start)
MsgBox(4096, "Result", 'Duration: ' & $Duration & @CRLF & 'key=' & $var)
I get 0.107 milliseconds.

What you use in your script depends on what you want to achieve. An ini file can be changed easily - so you don't have to change your script.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...