if (!hasInterface) exitWith {};

diag_log text "[MILSIM] (client) initializing Stats PFH";

_cpsPFH = [
	{ 
		[] call milsim_fnc_calculateClientStats;
	},
	"milsim_client_cps_interval" call CBA_settings_fnc_get,
	[],
	{ diag_log text format ["[MILSIM] (client) PFH loaded with interval %1 seconds", "milsim_client_cps_interval" call CBA_settings_fnc_get ] },
	{ diag_log text format ["[MILSIM] (client) PFH unloaded"] },
	{ "milsim_client_cps_enable" call CBA_settings_fnc_get },
	{ false },
	[]
] call CBA_fnc_createPerFrameHandlerObject;

player setVariable ["milsim_client_cps_handler", _cpsPFH];
