Created
March 15, 2014 11:47
-
-
Save BalestraPatrick/9565789 to your computer and use it in GitHub Desktop.
Easily calculate the bytes used in your Pebble app with the Persistent Storage API. The maximum memory you can use is 4kb.
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
int totalSize = 0; | |
// Adjust the value (in this example: 2000) to your maximum key that you know you're using in your app | |
for (int i = 0; i < 2000; i++) { | |
if (persist_exists(i)) { | |
int size = persist_get_size(i); | |
totalSize = totalSize + size; | |
} | |
} | |
APP_LOG(APP_LOG_LEVEL_DEBUG, "Persistent storage used = %d", totalSize); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment