Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- int main(int argc, char **argv) {
- FILE *input = fopen(argv[1], "r");
- struct tm result;
- struct char buffer[2000];
- time_t prev;
- bool first = true;
- while (fgets(buffer, 2000, input)) {
- struct tm res;
- strptime(buffer, "%Y/%m/%d %H:%M:%S\n", &res);
- time_t cur = mktime(&res);
- if (!first) {
- printf("%d\n", cur - prev);
- }
- prev = cur;
- first = false;
- }
- fclose(input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement