Jump to content
Sign in to follow this  
DCCD

Variables and INI files

Recommended Posts

DCCD

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)

Share this post


Link to post
Share on other sites
water

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 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×