Hello sven_a,
For me it looks like last_progress_minutes is not properly used in your code. The script is always checking that elapsed_min is bigger than 10 - which means that it is true always after 10 minutes from the processing stage start.
Here's a sample code that I've used, basing on your script, that should update the file contents either after 10% progress is passed or 10 minutes since the last update (or script start). For debugging purposes you can lower the threshold for percentage and raise for minutes or vice versa to check the behavior of any parameter.
import Metashape, time
def progress_print(p):
global start_time_processing_step
global last_progress_percentage
global last_progress_minutes
global file
elapsed = float(time.time() - start_time_processing_step)
elapsed_min = elapsed / 60 - last_progress_minutes
elapsed_progress = p - last_progress_percentage
if p and (elapsed_progress > 10 or elapsed_min > 10):
last_progress_minutes = elapsed_min
last_progress_percentage = p
file.write("{:.1f}%\t{:.2f} sec elapsed,\t{:.1f} min last\t{:.1f}% last\n".format(p, elapsed, last_progress_minutes, last_progress_percentage))
file.flush()
chunk = Metashape.app.document.chunk
global start_time_processing_step
global last_progress_percentage
global last_progress_minutes
global file
last_progress_percentage = 0
last_progress_minutes = 0
start_time_processing_step = time.time()
file = open("D:/progress.txt", "wt")
chunk.matchPhotos(accuracy = Metashape.LowAccuracy, progress=progress_print)
file.close()