What does this function do in Python?
I am new to python. 

    def maintain_delta(new_vals,host,action):
        file_name=build_file_name(host,action)
        err,data=read_values(file_name)
        old_vals=data.split(';')
        new_vals=[str(int(time.time()))]+new_vals
        delta=None
        try:
            err,delta= calc_delta(old_vals,new_vals)
        except:
            err=2
        write_res=write_values(file_name,";".join(str(x) for x in new_vals))
        return err+write_res,delta
         

source github [link][1]: 

From what I understand, it reads data from a file and adds time.time() function to get the new val. What does time.time() do? Does this function generate a file name?


  [1]: https://github.com/mzupan/nagios-plugin-mongodb/blob/master/check_mongodb.py
What does this function do in Python?
===

I am new to python. 

    def maintain_delta(new_vals,host,action):
        file_name=build_file_name(host,action)
        err,data=read_values(file_name)
        old_vals=data.split(';')
        new_vals=[str(int(time.time()))]+new_vals
        delta=None
        try:
            err,delta= calc_delta(old_vals,new_vals)
        except:
            err=2
        write_res=write_values(file_name,";".join(str(x) for x in new_vals))
        return err+write_res,delta
         

source github [link][1]: 

From what I understand, it reads data from a file and adds time.time() function to get the new val. What does time.time() do? Does this function generate a file name?


  [1]: https://github.com/mzupan/nagios-plugin-mongodb/blob/master/check_mongodb.py