Skip to content

Commit

Permalink
Merge pull request #12 from louist103/Time
Browse files Browse the repository at this point in the history
Time
  • Loading branch information
louist103 committed Feb 6, 2022
1 parent 3471d4c commit b394504
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libultraship/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <SDL2/SDL.h>
#include <map>
#include <string>
#include <chrono>

extern "C" {
struct OSMesgQueue;
Expand Down Expand Up @@ -149,6 +150,15 @@ extern "C" {
auto res = (Ship::Blob*)Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(blobPath).get();
return (char*)res->data.data();
}

/* Should these go in their own file?*/
uint64_t osGetTime(void) {
return std::chrono::steady_clock::now().time_since_epoch().count();
}

uint32_t osGetCount(void) {
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
}
}

extern "C" struct GfxRenderingAPI gfx_opengl_api;
Expand Down

0 comments on commit b394504

Please sign in to comment.