#include "debug.h"
String tsFields;
long ramScan_timeOut;
long str_timeOut;
int count;
#define TIMEOUT_RAMSCAN 2000
#define TIMEOUT_STRSCAN 1000
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//tsFields.reserve(128);
count = 0;
}
void loop() {
// put your main code here, to run repeatedly:
if((millis() - str_timeOut) > TIMEOUT_STRSCAN) {
str_timeOut = millis();
tsFields += "#";
test(tsFields);
if(++count % 16 == 0) {
tsFields.remove(0, tsFields.length());
}
}
if((millis() - ramScan_timeOut) > TIMEOUT_RAMSCAN) {
ramScan_timeOut = millis();
SerialPrintf("Free list: %d ,free RAM: %d\n",freeListCount(),freeMemory());
}
}
void test(String str) {
SerialPrintf("String len: %d \n", str.length());
}