Thanks a lot for your response!
I indeed talk about the Bitcoin Core.
I'm actually looking for a way to do it by the code, i.e. by the API of Bitcoin Core.
Do you know an API function that can fit?
Yes... use the
getwalletinfo command... in the JSON return, there is a "scanning" value that is set to either false or contains the details of the scan progress:
...
"scanning" : { (json object) current scanning details, or false if no scan is in progress
"duration" : n, (numeric) elapsed seconds since scan start
"progress" : n (numeric) scanning progress percentage [0.0, 1.0]
},
...