Page 1 of 1

"timestamp" parameter delay

Posted: 27 Nov 2022 11:09
by Norn
The greater the number of files in the list, the longer it takes to restore the timestamp, when $i<1000 the delay is 172.

Code: Select all

new("Test", dir);
 goto "<curpath>\Test";

 for($i=0; $i<100; $i++) {
     new($i.txt)
     }

 $modified = property("#date.m", <curitem>);
 writefile("<curitem>:Tags", "Test", , "utf8bom");
 $start = now("msecs");
 showstatus 0;
 timestamp "m", $modified, <curitem>;} 
 status now("msecs") - $start;

Re: "timestamp" parameter delay

Posted: 30 Nov 2022 17:28
by admin
Is that air code? Please look at it again and come up with a presentable example.

Re: "timestamp" parameter delay

Posted: 30 Nov 2022 20:01
by Norn
Sorry, the following are the detailed steps and results.
Create a folder with 50 files:

Code: Select all

new("Test50", dir);
 goto "<curpath>\Test50";

 for($i=0; $i<50; $i++) {
     new($i.txt);
     wait "1";
     }
Create another folder with 2000 files:

Code: Select all

new("Test2000", dir);
 goto "<curpath>\Test2000";

 for($i=0; $i<2000; $i++) {
     new($i.txt);
     wait "1";
     }
Select a file in each folder and execute the "timestamp" parameter respectively:

Code: Select all

 $modified = property("#date.m", <curitem>);   //Get modified time

 $start = now("msecs");   //Get current time
 timestamp "m", $modified, <curitem>;}   //Execute the timestamp parameter
 status "Delay is " . now("msecs") - $start . "ms";   //Calculate the time taken for "Execute the timestamp parameter"
Here is the result of selecting a file in a folder of 50 files and executing it:
50 items delay.png
50 items delay.png (1.32 KiB) Viewed 388 times
Here is the result of selecting a file in a folder of 1000 files and executing it:
1000 items delay.png
1000 items delay.png (2.01 KiB) Viewed 388 times

Re: "timestamp" parameter delay

Posted: 30 Nov 2022 20:29
by highend
Can't reproduce that. ~32 ms, regardless if I selected the first / the last file in a dir with 50 / 1000 files...

Re: "timestamp" parameter delay

Posted: 01 Dec 2022 11:51
by Norn
Weird, I can only reproduce it now in paper folder. not sure if this is an issue?
Normal folder:
folder 2000 files.png
folder 2000 files.png (1.92 KiB) Viewed 361 times
Paper folder:
Paper folder 2000.png
Paper folder 2000.png (2.07 KiB) Viewed 361 times