A method of dosing biocide into a fluid system, the method is carried out after a, such as between two subsequent, dosing of biocide into the fluid system, the fluid system comprising • a biofilm sensor arranged in the fluid system and having sensing surface exposed to a flow fluid in the fluid system, when fluid is present in the system, the sensor is configured to measure an amount of biofilm on said sensing surface of the biofilm sensor, • a dosing pump arranged in the fluid system to dose biocide into fluid system; the method being carried out in a number of sequences on the basis of data sets representing measurements obtained by the biofilm sensor of the amount of biofilm subsequent to a most recent dosing of biocide, said a sequence comprising the steps of: i) identifying, if present, in said data set a minimum and, if identified, record that a minimum has been identified; ii) identifying, if present, in said data set that an inflection point and, if identified, record that an inflection point has been identified; iii) if an inflection point has been identified occurring time wise after an identified minimum, determining a point in time for dosing by use of the dosing pump biocide into the fluid system; • if an inflection point has not been identified occurring time wise after an identified minimum, obtaining a new data set by appending new available data, if any, to said data set and execute steps i)-iii) on the new data set until step iii) is fulfilled; wherein • the point in time for dosing is determined by recurrently obtaining a new data set by appending new available data, if any, to a current data set and determine the point in time where the data set fulfils a predefined dosing criteria, and wherein the method further comprising • dosing by use of the dosing pump biocide into the fluid system when said predefined criteria is fulfilled. • a biofilm sensor arranged in the fluid system and having sensing surface exposed to a flow fluid in the fluid system, when fluid is present in the system, the sensor is configured to measure an amount of biofilm on said sensing surface of the biofilm sensor, • a dosing pump arranged in the fluid system to dose biocide into fluid system; the method being carried out in a number of sequences on the basis of data sets representing measurements obtained by the biofilm sensor of the amount of biofilm subsequent to a most recent dosing of biocide, said a sequence comprising the steps of: i) identifying, if present, in said data set a minimum and, if identified, record that a minimum has been identified; ii) identifying, if present, in said data set that an inflection point and, if identified, record that an inflection point has been identified; iii) if an inflection point has been identified occurring time wise after an identified minimum, determining a point in time for dosing by use of the dosing pump biocide into the fluid system; i) identifying, if present, in said data set a minimum and, if identified, record that a minimum has been identified; ii) identifying, if present, in said data set that an inflection point and, if identified, record that an inflection point has been identified; iii) if an inflection point has been identified occurring time wise after an identified minimum, determining a point in time for dosing by use of the dosing pump biocide into the fluid system; • if an inflection point has not been identified occurring time wise after an identified minimum, obtaining a new data set by appending new available data, if any, to said data set and execute steps i)-iii) on the new data set until step iii) is fulfilled; wherein • the point in time for dosing is determined by recurrently obtaining a new data set by appending new available data, if any, to a current data set and determine the point in time where the data set fulfils a predefined dosing criteria, and wherein the method further comprising • dosing by use of the dosing pump biocide into the fluid system when said predefined criteria is fulfilled.