Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Mobile Development
  3. Mobile
  4. C code help

C code help

Scheduled Pinned Locked Moved Mobile
hardwareperformancehelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sirrius
    wrote on last edited by
    #1

    All I'm trying to do here is calculate the clock time of the computer with a couple C functions. The author of the book tells me "kind of" how to do it but still kind of vague. I am getting a number, but it doesn't seem to be close to the clock speed of the computer(which is 133mhz, yeah yeah, I know it's slow but it boots my embedded apps okay)instead I'm getting a number like 231851640624.......about 20 digits long. Can somebody tell me what I'm doing wrong with my code? Thanks. #include "libepc.h" int main(void) { ClearScreen(0x07) ; SetCursorPosition(10,20); DWORD32 timeout; long long speed; speed=CPU_Clock_Cycles(); PutUnsigned(speed,10,0); timeout = Now_Plus(1); while(Now_Plus(0) < timeout) { speed=CPU_Clock_Cycles(); } PutUnsigned(speed,10,0); return 0 ; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups