Sign in to follow this  
Followers 0
DCCD

Variables and INI files

3 posts in this topic

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



#2 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

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  
Followers 0