-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·31 lines (24 loc) · 995 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
size=$1
files_list=""
t=$(($(date +%s%N)/1000000))
for ((i=1; i<=size; i++)); do
touch "test$i"
files_list+="test$i "
done
t=$(($(date +%s%N)/1000000-t))
echo "Files creation time: $t ms"
t=$(($(date +%s%N)/1000000))
busctl --quiet --user call org.trash.trashd /org/trash/trashd org.trash.trashd Trash "as" $size $(realpath $files_list)
t=$(($(date +%s%N)/1000000-t))
echo "Trashing time: $t ms"
echo "Number of trashed files: $(busctl --user call org.trash.trashd /org/trash/trashd org.trash.trashd Length)"
t=$(($(date +%s%N)/1000000))
busctl --quiet --user call org.trash.trashd /org/trash/trashd org.trash.trashd List
t=$(($(date +%s%N)/1000000-t))
echo "Listing time: $t ms"
t=$(($(date +%s%N)/1000000))
busctl --quiet --user call org.trash.trashd /org/trash/trashd org.trash.trashd EraseAll
t=$(($(date +%s%N)/1000000-t))
echo "Erasing time: $t ms"
echo "Number of trashed files: $(busctl --user call org.trash.trashd /org/trash/trashd org.trash.trashd Length)"