Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. code:
  2. string16 TaskManagerModel::GetResourceCPUUsage(int index) const {
  3. CHECK_LT(index, ResourceCount());
  4.  
  5. std::string foo = UTF16ToUTF8(WideToUTF16Hack(StringPrintf(L"%.0f", GetCPUUsage(resources_[index]))));
  6. printf("%s: [%.0f], [%s]\n", __PRETTY_FUNCTION__, GetCPUUsage(resources_[index]), foo.c_str());
  7.  
  8. return WideToUTF16Hack(StringPrintf(
  9. #if defined(OS_MACOSX)
  10. // Activity Monitor shows %cpu with one decimal digit -- be
  11. // consistent with that.
  12. L"%.1f",
  13. #else
  14. L"%.0f",
  15. #endif
  16. GetCPUUsage(resources_[index])));
  17. }
  18.  
  19. result:
  20. string16 TaskManagerModel::GetResourceCPUUsage(int) const: [3], []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement