Created
August 12, 2014 16:13
-
-
Save mumblepins/e141962fa063a57d4def to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(115200); | |
while (!Serial.available()) SPARK_WLAN_Loop(); | |
} | |
double avgDelay; | |
double totalDelay; | |
unsigned long timer1; | |
unsigned long timer2; | |
int count=0; | |
void loop() { | |
count++; | |
timer1=micros(); | |
Spark.publish("This is a test","of the spark publish function"); | |
timer2=micros(); | |
totalDelay+=timer2-timer1; | |
avgDelay=totalDelay/(double)count; | |
Serial.print(timer2-timer1); | |
Serial.print(" "); | |
Serial.println(avgDelay); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment