mirror of
https://github.com/NotXia/dotfiles.git
synced 2025-12-14 18:11:52 +01:00
45 lines
997 B
JSON
45 lines
997 B
JSON
{
|
|
"C++ Template": {
|
|
"prefix": "C++ template",
|
|
"body": [
|
|
"$BLOCK_COMMENT_START",
|
|
" Descrizione: $1",
|
|
" Autore: Tian Cheng Xia",
|
|
" Data: $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
|
|
"$BLOCK_COMMENT_END",
|
|
"#include <iostream>",
|
|
"using namespace std;",
|
|
"",
|
|
"int main() {",
|
|
" $0",
|
|
" return 0;",
|
|
"}"
|
|
],
|
|
"description": "C++ template"
|
|
},
|
|
|
|
"Execution time": {
|
|
"prefix": "exectime",
|
|
"body": [
|
|
"#include <iostream>",
|
|
"#include <ctime>",
|
|
"using namespace std;",
|
|
"",
|
|
"int main() {",
|
|
" clock_t t_start, t_end;",
|
|
" t_start = clock();",
|
|
"",
|
|
" // Code --",
|
|
" $0",
|
|
" // -------",
|
|
"",
|
|
" t_end = clock();",
|
|
" double time = double(t_end - t_start) / double(CLOCKS_PER_SEC);",
|
|
" cout.precision(17);",
|
|
" cout <<\"Tempo di esecuzione: \" << fixed <<time <<\" s\";",
|
|
" return 0;",
|
|
"}"
|
|
],
|
|
"description": "C++ template"
|
|
}
|
|
} |