File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
libs/openFrameworks/utils Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,10 @@ uint64_t ofGetUnixTime(){
337337 return static_cast <uint64_t >(time (nullptr ));
338338}
339339
340+ uint64_t ofGetUnixTimeMillis () {
341+ auto elapsed = std::chrono::system_clock::now ().time_since_epoch ();
342+ return std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count ();
343+ }
340344
341345// --------------------------------------
342346void ofSleepMillis (int millis){
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ void ofResetElapsedTimeCounter();
3232// / \returns the floating point elapsed time in seconds.
3333float ofGetElapsedTimef ();
3434
35+ // / \brief Get the Unix Time in milliseconds.
36+ // /
37+ // / This returns the milliseconds since Midnight, January 1, 1970.
38+ // /
39+ // / \returns the milliseconds since Midnight, January 1, 1970.
40+ uint64_t ofGetUnixTimeMillis ();
3541
3642// / \brief Get the elapsed time in milliseconds.
3743// /
You can’t perform that action at this time.
0 commit comments